Class: Yelp::V1::Neighborhood::Request::Location

Inherits:
Base show all
Defined in:
lib/yelpster/v1/neighborhood/request/location.rb

Overview

Describes a request to search for a neighborhood name for a specific address/location. You do not need to specify all of the address attributes – some subset of the core address, city, state and zipcode will suffice.

Instance Attribute Summary collapse

Attributes inherited from Request

#response_format, #yws_id

Instance Method Summary collapse

Methods inherited from Base

#base_url

Methods inherited from Request

#pull_results

Constructor Details

#initialize(params) ⇒ Location

Returns a new instance of Location


25
26
27
28
29
30
31
32
33
34
35
# File 'lib/yelpster/v1/neighborhood/request/location.rb', line 25

def initialize (params)
  # we explicitly initialize the location fields since we reference
  # them later when building a full location string and we want
  # to know they were initialized properly (and avoid warnings)
  super({
    :address => nil,
    :city => nil,
    :state => nil,
    :zipcode => nil
  }.merge(params))
end

Instance Attribute Details

#addressObject (readonly)

the street address of the location sought


14
15
16
# File 'lib/yelpster/v1/neighborhood/request/location.rb', line 14

def address
  @address
end

#cityObject (readonly)

the city of the location sought


17
18
19
# File 'lib/yelpster/v1/neighborhood/request/location.rb', line 17

def city
  @city
end

#stateObject (readonly)

the state of the location sought


20
21
22
# File 'lib/yelpster/v1/neighborhood/request/location.rb', line 20

def state
  @state
end

#zipcodeObject (readonly)

the zipcode of the location sought


23
24
25
# File 'lib/yelpster/v1/neighborhood/request/location.rb', line 23

def zipcode
  @zipcode
end

Instance Method Details

#to_yelp_paramsObject


37
38
39
# File 'lib/yelpster/v1/neighborhood/request/location.rb', line 37

def to_yelp_params
  super.merge(:location => build_location_string)
end