Class: Badgrcat::ApiArray
Instance Attribute Summary
#members, #raw_response
Class Method Summary
collapse
Instance Method Summary
collapse
#all_pages!, #all_pages_each, #each, #each_page, #initialize, #last, make_indifferent, #method, #page_count, #pages?, process_response
Class Method Details
.array_key(response) ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/badgrcat/api_array.rb', line 17
def self.array_key(response)
if response.body.is_a?(Hash) && response.body.key?("result")
"result"
else
nil
end
end
|
Instance Method Details
#[](key) ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/badgrcat/api_array.rb', line 5
def [](key)
if key.is_a?(Numeric)
super
else
@raw_response.body[key]
end
end
|
#status ⇒ Object
13
14
15
|
# File 'lib/badgrcat/api_array.rb', line 13
def status
self["status"]
end
|