Class: Hyperpublic::Offers
- Extended by:
- Forwardable
- Defined in:
- lib/hyperpublic/offers.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #find(params = {}) ⇒ Object
-
#initialize(client) ⇒ Offers
constructor
A new instance of Offers.
- #show(id) ⇒ Object
Methods inherited from Base
#photos, #search_neighborhoods, #search_tags
Constructor Details
#initialize(client) ⇒ Offers
Returns a new instance of Offers.
9 10 11 |
# File 'lib/hyperpublic/offers.rb', line 9 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
7 8 9 |
# File 'lib/hyperpublic/offers.rb', line 7 def client @client end |
Instance Method Details
#find(params = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/hyperpublic/offers.rb', line 13 def find(params={}) if params.is_a? String perform_get("/offers/#{params}") else q = Addressable::URI.new q.query_values = stringify(params) perform_get("/offers?#{q.query}") end end |
#show(id) ⇒ Object
23 24 25 |
# File 'lib/hyperpublic/offers.rb', line 23 def show(id) perform_get("/offers/#{id}") end |