Class: Yelp::V1::Neighborhood::Request::Location
- Defined in:
- lib/yelped/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
-
#address ⇒ Object
readonly
the street address of the location sought.
-
#city ⇒ Object
readonly
the city of the location sought.
-
#state ⇒ Object
readonly
the state of the location sought.
-
#zipcode ⇒ Object
readonly
the zipcode of the location sought.
Attributes inherited from Request
#compress_response, #response_format, #yws_id
Instance Method Summary collapse
-
#initialize(params) ⇒ Location
constructor
A new instance of Location.
- #to_yelp_params ⇒ Object
Methods inherited from Base
Methods inherited from Request
Constructor Details
#initialize(params) ⇒ Location
Returns a new instance of Location.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/yelped/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
#address ⇒ Object (readonly)
the street address of the location sought
14 15 16 |
# File 'lib/yelped/v1/neighborhood/request/location.rb', line 14 def address @address end |
#city ⇒ Object (readonly)
the city of the location sought
17 18 19 |
# File 'lib/yelped/v1/neighborhood/request/location.rb', line 17 def city @city end |
#state ⇒ Object (readonly)
the state of the location sought
20 21 22 |
# File 'lib/yelped/v1/neighborhood/request/location.rb', line 20 def state @state end |
#zipcode ⇒ Object (readonly)
the zipcode of the location sought
23 24 25 |
# File 'lib/yelped/v1/neighborhood/request/location.rb', line 23 def zipcode @zipcode end |
Instance Method Details
#to_yelp_params ⇒ Object
37 38 39 |
# File 'lib/yelped/v1/neighborhood/request/location.rb', line 37 def to_yelp_params super.merge(:location => build_location_string) end |