Class: Cameraplus::Search

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ Search

Returns a new instance of Search.



11
12
13
14
# File 'lib/cameraplus/search.rb', line 11

def initialize(result)
  @result ||= result
  parse
end

Instance Attribute Details

#pageObject (readonly)

Returns the value of attribute page.



4
5
6
# File 'lib/cameraplus/search.rb', line 4

def page
  @page
end

#photosObject (readonly)

Returns the value of attribute photos.



4
5
6
# File 'lib/cameraplus/search.rb', line 4

def photos
  @photos
end

#userObject (readonly)

Returns the value of attribute user.



4
5
6
# File 'lib/cameraplus/search.rb', line 4

def user
  @user
end

Class Method Details

.find(filters) ⇒ Object



6
7
8
9
# File 'lib/cameraplus/search.rb', line 6

def self.find(filters)
  results = Cameraplus::API::Search.find filters
  results.map { |result| new result }
end