Class: Dmm::Result
Instance Method Summary collapse
-
#first_position ⇒ Integer
Returns a position of first item.
-
#items ⇒ Array<Dmm::Item>
Returns a array containing Dmm::Item object.
-
#result_count ⇒ Integer
Returns a count of result data.
-
#total_count ⇒ Integer
Returns a count of total data.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Dmm::Base
Instance Method Details
#first_position ⇒ Integer
Returns a position of first item
24 25 26 |
# File 'lib/dmm/result.rb', line 24 def first_position @attrs[:first_position].to_i end |
#items ⇒ Array<Dmm::Item>
Returns a array containing Dmm::Item object
31 32 33 34 35 36 |
# File 'lib/dmm/result.rb', line 31 def items return [] unless @attrs[:items] item_list = @attrs[:items][:item] item_list = [item_list] if item_list.kind_of? Hash item_list.map! { |item| Dmm::Item.new(item) } end |
#result_count ⇒ Integer
Returns a count of result data
10 11 12 |
# File 'lib/dmm/result.rb', line 10 def result_count @attrs[:result_count].to_i end |
#total_count ⇒ Integer
Returns a count of total data
17 18 19 |
# File 'lib/dmm/result.rb', line 17 def total_count @attrs[:total_count].to_i end |