Class: Hyperpublic::Offers

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/hyperpublic/offers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#clientObject (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