Class: GoogleImageApi::Result
- Inherits:
-
Object
- Object
- GoogleImageApi::Result
- Defined in:
- lib/google_image_api/result.rb
Instance Method Summary collapse
- #images ⇒ Object
-
#initialize(json) ⇒ Result
constructor
A new instance of Result.
- #json ⇒ Object
- #page ⇒ Object
- #raw_data ⇒ Object
Constructor Details
#initialize(json) ⇒ Result
Returns a new instance of Result.
3 4 5 6 7 |
# File 'lib/google_image_api/result.rb', line 3 def initialize(json) require 'json' @json = json @data = JSON::load(json) end |
Instance Method Details
#images ⇒ Object
13 14 15 |
# File 'lib/google_image_api/result.rb', line 13 def images @data["responseData"]["results"] end |
#json ⇒ Object
21 22 23 |
# File 'lib/google_image_api/result.rb', line 21 def json @json end |
#page ⇒ Object
9 10 11 |
# File 'lib/google_image_api/result.rb', line 9 def page @data.first end |
#raw_data ⇒ Object
17 18 19 |
# File 'lib/google_image_api/result.rb', line 17 def raw_data @data end |