I have what I assumed was a very simple method within my controller:
class ReportsController < ApplicationController
  client = MWS.reports
  def request_all_listings
    begin
      parser = client.request_report('_GET_FLAT_FILE_OPEN_LISTINGS_DATA_', opts = {})
      @result = parser.parse["ReportRequestInfo"]["ReportProcessingStatus"]
      puts @result
    rescue Excon::Errors::ServiceUnavailable => e
      logger.warn e.response.message
      retry
    end
  end
  request_all_listings
end
This gives me the error:
 undefined local variable or method `request_all_listings' for ReportsController:Class
What am I doing wrong here? When I delete the def request_all_listings def and end lines and just have the begin/rescue/end my code works fine...
 
     
     
    