Class: MajesticSeo::Api::ItemInfoResponse
- Defined in:
- lib/majestic_seo/api/item_info_response.rb
Instance Attribute Summary
Attributes inherited from Response
#code, #error_message, #full_error, #global_variables, #items, #response, #success, #table_key, #tables
Instance Method Summary collapse
-
#initialize(response, table_key = "Results") ⇒ ItemInfoResponse
constructor
A new instance of ItemInfoResponse.
- #parse_item_info_objects ⇒ Object
Methods inherited from Response
#parse_global_variables, #parse_response, #parse_table, #parse_tables, #stacktrace, #success?
Constructor Details
#initialize(response, table_key = "Results") ⇒ ItemInfoResponse
Returns a new instance of ItemInfoResponse.
37 38 39 40 41 |
# File 'lib/majestic_seo/api/item_info_response.rb', line 37 def initialize(response, table_key = "Results") self.table_key = table_key super(response) parse_item_info_objects end |
Instance Method Details
#parse_item_info_objects ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/majestic_seo/api/item_info_response.rb', line 43 def parse_item_info_objects parsed = [] item_infos = self.items if (item_infos && item_infos.any?) item_infos.each do |item_info| parsed << MajesticSeo::Api::ItemInfo.new(item_info) end @items = parsed if (parsed.any?) end end |