Class: Hyperpublic::Base

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

Direct Known Subclasses

All, Categories, Offers, People, Places, Things

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Base

Returns a new instance of Base.



11
12
13
# File 'lib/hyperpublic/base.rb', line 11

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



9
10
11
# File 'lib/hyperpublic/base.rb', line 9

def client
  @client
end

Instance Method Details

#photos(params) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/hyperpublic/base.rb', line 23

def photos(params)
  query = {}
  case
    when params[:ids] then query[:ids] = params[:ids]
    when params[:object_id] && params[:object_type] then 
      begin
        query[:object_id] = params[:object_id]
        query[:object_type] = params[:object_type]
      end
  end

  perform_get("/photos", query)
end

#search_neighborhoods(search_string, limit) ⇒ Object



15
16
17
# File 'lib/hyperpublic/base.rb', line 15

def search_neighborhoods(search_string, limit)
  perform_get("/locations/search_neighborhoods", {:search_string => search_string, :limit => limit})
end

#search_tags(search_string, limit) ⇒ Object



19
20
21
# File 'lib/hyperpublic/base.rb', line 19

def search_tags(search_string, limit)
  perform_get("/tags/search", {:search_string => search_string, :limit => limit})
end