Class: SinglePlatform::Location
- Inherits:
-
Object
- Object
- SinglePlatform::Location
- Defined in:
- lib/single_platform/location.rb
Instance Attribute Summary collapse
-
#business_type ⇒ Object
readonly
Returns the value of attribute business_type.
-
#factual_id ⇒ Object
readonly
Returns the value of attribute factual_id.
-
#general ⇒ Object
readonly
Returns the value of attribute general.
-
#hours ⇒ Object
readonly
Returns the value of attribute hours.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#menus ⇒ Object
readonly
Returns the value of attribute menus.
-
#out_of_business ⇒ Object
readonly
Returns the value of attribute out_of_business.
-
#phones ⇒ Object
readonly
Returns the value of attribute phones.
-
#published_at ⇒ Object
readonly
Returns the value of attribute published_at.
Class Method Summary collapse
Instance Method Summary collapse
- #fetch_menus ⇒ Object
-
#initialize(data) ⇒ Location
constructor
A new instance of Location.
Constructor Details
#initialize(data) ⇒ Location
Returns a new instance of Location.
13 14 15 16 17 |
# File 'lib/single_platform/location.rb', line 13 def initialize(data) data.each do |key, value| instance_variable_set :"@#{key.underscore}", value end end |
Instance Attribute Details
#business_type ⇒ Object (readonly)
Returns the value of attribute business_type.
3 4 5 |
# File 'lib/single_platform/location.rb', line 3 def business_type @business_type end |
#factual_id ⇒ Object (readonly)
Returns the value of attribute factual_id.
3 4 5 |
# File 'lib/single_platform/location.rb', line 3 def factual_id @factual_id end |
#general ⇒ Object (readonly)
Returns the value of attribute general.
3 4 5 |
# File 'lib/single_platform/location.rb', line 3 def general @general end |
#hours ⇒ Object (readonly)
Returns the value of attribute hours.
3 4 5 |
# File 'lib/single_platform/location.rb', line 3 def hours @hours end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/single_platform/location.rb', line 3 def id @id end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
3 4 5 |
# File 'lib/single_platform/location.rb', line 3 def location @location end |
#menus ⇒ Object (readonly)
Returns the value of attribute menus.
4 5 6 |
# File 'lib/single_platform/location.rb', line 4 def @menus end |
#out_of_business ⇒ Object (readonly)
Returns the value of attribute out_of_business.
3 4 5 |
# File 'lib/single_platform/location.rb', line 3 def out_of_business @out_of_business end |
#phones ⇒ Object (readonly)
Returns the value of attribute phones.
3 4 5 |
# File 'lib/single_platform/location.rb', line 3 def phones @phones end |
#published_at ⇒ Object (readonly)
Returns the value of attribute published_at.
3 4 5 |
# File 'lib/single_platform/location.rb', line 3 def published_at @published_at end |
Class Method Details
.in_zipcode(zipcode, opts = {}) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/single_platform/location.rb', line 6 def self.in_zipcode(zipcode, opts={}) data = in_zipcode_request(zipcode, opts) locations = parse_locations(data) locations.each(&:fetch_menus) if opts[:include_menus] locations end |
Instance Method Details
#fetch_menus ⇒ Object
19 20 21 |
# File 'lib/single_platform/location.rb', line 19 def @menus = SinglePlatform::Menu.(self) end |