Class: GolfSwitch::AltRateType
- Inherits:
-
Object
- Object
- GolfSwitch::AltRateType
- Defined in:
- lib/golf_switch/alt_rate_type.rb
Instance Attribute Summary collapse
-
#desc ⇒ Object
Returns the value of attribute desc.
-
#id ⇒ Object
Returns the value of attribute id.
-
#nm ⇒ Object
Returns the value of attribute nm.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ AltRateType
constructor
A new instance of AltRateType.
Constructor Details
#initialize(attributes = {}) ⇒ AltRateType
Returns a new instance of AltRateType.
5 6 7 8 9 10 11 12 13 |
# File 'lib/golf_switch/alt_rate_type.rb', line 5 def initialize(attributes={}) attributes.each do |name, value| begin send("#{name}=", value) rescue puts "Add #{name} to accessor in alt rate type" end end end |
Instance Attribute Details
#desc ⇒ Object
Returns the value of attribute desc.
3 4 5 |
# File 'lib/golf_switch/alt_rate_type.rb', line 3 def desc @desc end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/golf_switch/alt_rate_type.rb', line 3 def id @id end |
#nm ⇒ Object
Returns the value of attribute nm.
3 4 5 |
# File 'lib/golf_switch/alt_rate_type.rb', line 3 def nm @nm end |
Class Method Details
.patse_alt_rate_types(response) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/golf_switch/alt_rate_type.rb', line 15 def self.patse_alt_rate_types(response) alt_rate_types = [] if response[:alt_rate_types].is_a?(Array) response[:alt_rate_types].each do |alt_rate_type| alt_rate_types << GolfSwitch::AltRateType.new(alt_rate_types) end elsif response[:alt_rate_types].is_a?(Hash) alt_rate_types << GolfSwitch::AltRateType.new(response[:alt_rate_types]) end alt_rate_types end |