class BookingLocations::Location
Public Class Methods
find(id)
click to toggle source
# File lib/booking_locations/location.rb, line 12 def self.find(id) BookingLocations.find(id) end
new(data)
click to toggle source
# File lib/booking_locations/location.rb, line 8 def initialize(data) @data = data end
Public Instance Methods
address()
click to toggle source
# File lib/booking_locations/location.rb, line 28 def address @data['address'] end
guider_name_for(guider_id)
click to toggle source
# File lib/booking_locations/location.rb, line 67 def guider_name_for(guider_id) guiders.find { |guider| guider.id == guider_id }.name end
guiders()
click to toggle source
# File lib/booking_locations/location.rb, line 63 def guiders @guiders ||= @data['guiders'].map { |guider| OpenStruct.new(guider) } end
id()
click to toggle source
# File lib/booking_locations/location.rb, line 16 def id @data['uid'] end
location_for(location_id)
click to toggle source
# File lib/booking_locations/location.rb, line 71 def location_for(location_id) return self if id == location_id locations.find { |location| location.id == location_id } end
locations()
click to toggle source
# File lib/booking_locations/location.rb, line 59 def locations @locations ||= @data['locations'].map { |child_data| Location.new(child_data) } end
name()
click to toggle source
# File lib/booking_locations/location.rb, line 20 def name @data['name'] end
name_for(location_id)
click to toggle source
# File lib/booking_locations/location.rb, line 77 def name_for(location_id) found = location_for(location_id) found ? found.name : '' end
online_booking_reply_to()
click to toggle source
# File lib/booking_locations/location.rb, line 36 def online_booking_reply_to @data['online_booking_reply_to'] end
online_booking_twilio_number()
click to toggle source
# File lib/booking_locations/location.rb, line 32 def online_booking_twilio_number @data['online_booking_twilio_number'] end
online_booking_weekends()
click to toggle source
# File lib/booking_locations/location.rb, line 40 def online_booking_weekends @data['online_booking_weekends'] end
Also aliased as: online_booking_weekends?
organisation()
click to toggle source
# File lib/booking_locations/location.rb, line 55 def organisation @data['organisation'] end
realtime()
click to toggle source
# File lib/booking_locations/location.rb, line 50 def realtime @data['realtime'] end
Also aliased as: realtime?
title()
click to toggle source
# File lib/booking_locations/location.rb, line 24 def title @data['title'] end