Class: Fleakr::Objects::Search

Inherits:
Object
  • Object
show all
Defined in:
lib/fleakr/objects/search.rb

Instance Method Summary collapse

Constructor Details

#initialize(search_options) ⇒ Search

Create a new search



6
7
8
# File 'lib/fleakr/objects/search.rb', line 6

def initialize(search_options)
  @search_options = search_options
end

Instance Method Details

#resultsObject

Retrieve search results from the API



11
12
13
14
15
16
# File 'lib/fleakr/objects/search.rb', line 11

def results
  @results ||= begin
    response = Fleakr::Api::MethodRequest.with_response!('photos.search', parameters)
    (response.body/'rsp/photos/photo').map {|p| Photo.new(p) }
  end
end