Class: Gillbus::TripOptions

Inherits:
Object
  • Object
show all
Extended by:
Fields
Includes:
UpdateAttrs
Defined in:
lib/gillbus/structs/trip_options.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Fields

parse, parser, parser_class

Methods included from UpdateAttrs

#initialize, #update_attrs

Class Method Details

.build_blankObject



93
94
95
96
97
98
99
# File 'lib/gillbus/structs/trip_options.rb', line 93

def self.build_blank
  options = new
  field_definitions.each do |name:, type:, key:, root:|
    options.send(:"#{name}=", []) if type.is_a?(Array)
  end
  options
end

Instance Method Details

#advertisingObject



85
86
87
# File 'lib/gillbus/structs/trip_options.rb', line 85

def advertising
  promo.include?('ADVERTISING')
end

#busfor_recommendObject



89
90
91
# File 'lib/gillbus/structs/trip_options.rb', line 89

def busfor_recommend
  promo.include?('BUSFOR_RECOMMEND')
end