Class: ActiveInTime::Facility
- Inherits:
-
Object
- Object
- ActiveInTime::Facility
- Defined in:
- lib/ait_connect/facility.rb
Instance Attribute Summary collapse
-
#json ⇒ Object
readonly
Returns the value of attribute json.
Instance Method Summary collapse
- #facility_type ⇒ Object
-
#id ⇒ Object
def fetch @json = @active_in_time.get(“timetables/##id”)[“timetable”] self end.
-
#initialize(active_in_time, json) ⇒ Facility
constructor
A new instance of Facility.
- #length ⇒ Object
- #name ⇒ Object
- #tldc_approved ⇒ Object
Constructor Details
#initialize(active_in_time, json) ⇒ Facility
Returns a new instance of Facility.
5 6 7 |
# File 'lib/ait_connect/facility.rb', line 5 def initialize(active_in_time, json) @active_in_time, @json = active_in_time, json end |
Instance Attribute Details
#json ⇒ Object (readonly)
Returns the value of attribute json.
3 4 5 |
# File 'lib/ait_connect/facility.rb', line 3 def json @json end |
Instance Method Details
#facility_type ⇒ Object
30 31 32 33 |
# File 'lib/ait_connect/facility.rb', line 30 def facility_type return nil if !@json['facility_type'] ActiveInTime::FacilityType.new(@active_in_time, @json['facility_type']) end |
#id ⇒ Object
def fetch
@json = @active_in_time.get("timetables/#{id}")["timetable"]
self
end
14 15 16 |
# File 'lib/ait_connect/facility.rb', line 14 def id @json["id"] end |
#length ⇒ Object
26 27 28 |
# File 'lib/ait_connect/facility.rb', line 26 def length @json['length'] end |
#name ⇒ Object
18 19 20 |
# File 'lib/ait_connect/facility.rb', line 18 def name @json["primary_name"] end |
#tldc_approved ⇒ Object
22 23 24 |
# File 'lib/ait_connect/facility.rb', line 22 def tldc_approved @json['tldc_approved'] end |