Module: FbGraph::Page::Categories::LocalBusiness
- Included in:
- FbGraph::Page
- Defined in:
- lib/fb_graph/page/categories/local_business.rb
Instance Attribute Summary collapse
-
#attire ⇒ Object
Returns the value of attribute attire.
-
#general_manager ⇒ Object
Returns the value of attribute general_manager.
-
#hours ⇒ Object
Returns the value of attribute hours.
-
#parking ⇒ Object
Returns the value of attribute parking.
-
#payment_options ⇒ Object
Returns the value of attribute payment_options.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#price_range ⇒ Object
Returns the value of attribute price_range.
-
#public_transit ⇒ Object
Returns the value of attribute public_transit.
-
#restaurant_services ⇒ Object
Returns the value of attribute restaurant_services.
-
#restaurant_specialties ⇒ Object
Returns the value of attribute restaurant_specialties.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#attire ⇒ Object
Returns the value of attribute attire.
5 6 7 |
# File 'lib/fb_graph/page/categories/local_business.rb', line 5 def attire @attire end |
#general_manager ⇒ Object
Returns the value of attribute general_manager.
5 6 7 |
# File 'lib/fb_graph/page/categories/local_business.rb', line 5 def general_manager @general_manager end |
#hours ⇒ Object
Returns the value of attribute hours.
5 6 7 |
# File 'lib/fb_graph/page/categories/local_business.rb', line 5 def hours @hours end |
#parking ⇒ Object
Returns the value of attribute parking.
5 6 7 |
# File 'lib/fb_graph/page/categories/local_business.rb', line 5 def parking @parking end |
#payment_options ⇒ Object
Returns the value of attribute payment_options.
5 6 7 |
# File 'lib/fb_graph/page/categories/local_business.rb', line 5 def @payment_options end |
#phone ⇒ Object
Returns the value of attribute phone.
5 6 7 |
# File 'lib/fb_graph/page/categories/local_business.rb', line 5 def phone @phone end |
#price_range ⇒ Object
Returns the value of attribute price_range.
5 6 7 |
# File 'lib/fb_graph/page/categories/local_business.rb', line 5 def price_range @price_range end |
#public_transit ⇒ Object
Returns the value of attribute public_transit.
5 6 7 |
# File 'lib/fb_graph/page/categories/local_business.rb', line 5 def public_transit @public_transit end |
#restaurant_services ⇒ Object
Returns the value of attribute restaurant_services.
5 6 7 |
# File 'lib/fb_graph/page/categories/local_business.rb', line 5 def restaurant_services @restaurant_services end |
#restaurant_specialties ⇒ Object
Returns the value of attribute restaurant_specialties.
5 6 7 |
# File 'lib/fb_graph/page/categories/local_business.rb', line 5 def restaurant_specialties @restaurant_specialties end |
Class Method Details
.included(klass) ⇒ Object
7 8 9 |
# File 'lib/fb_graph/page/categories/local_business.rb', line 7 def self.included(klass) klass.alias_method_chain :initialize, :category_specific_attributes end |
Instance Method Details
#initialize_with_category_specific_attributes(identifier, attributes = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/fb_graph/page/categories/local_business.rb', line 11 def initialize_with_category_specific_attributes(identifier, attributes = {}) initialize_without_category_specific_attributes identifier, attributes [:attire, :general_manager, :phone, :price_range, :public_transit].each do |key| self.send :"#{key}=", attributes[key] end [:parking, :payment_options, :restaurant_services, :restaurant_specialties].each do |key| self.send :"#{key}=", [] if attributes[key] self.send :"#{key}=", attributes[key].keys.collect(&:to_sym) end end @hours = {} if attributes[:hours] utc_beginning_of_day = Time.now.utc.beginning_of_day attributes[:hours].each do |key, value| date, index, mode = key.split('_') index = index.to_i - 1 date, mode = date.to_sym, mode.to_sym @hours[date] ||= [] @hours[date][index] ||= {} @hours[date][index][mode] = value.since(utc_beginning_of_day) end end end |