Class: DatagroutConduit::Byok
- Inherits:
-
Struct
- Object
- Struct
- DatagroutConduit::Byok
- Defined in:
- lib/datagrout_conduit/types.rb
Instance Attribute Summary collapse
-
#discount_applied ⇒ Object
Returns the value of attribute discount_applied.
-
#discount_rate ⇒ Object
Returns the value of attribute discount_rate.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
Class Method Summary collapse
Instance Attribute Details
#discount_applied ⇒ Object
Returns the value of attribute discount_applied
22 23 24 |
# File 'lib/datagrout_conduit/types.rb', line 22 def discount_applied @discount_applied end |
#discount_rate ⇒ Object
Returns the value of attribute discount_rate
22 23 24 |
# File 'lib/datagrout_conduit/types.rb', line 22 def discount_rate @discount_rate end |
#enabled ⇒ Object
Returns the value of attribute enabled
22 23 24 |
# File 'lib/datagrout_conduit/types.rb', line 22 def enabled @enabled end |
Class Method Details
.from_hash(hash) ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/datagrout_conduit/types.rb', line 23 def self.from_hash(hash) return new(enabled: false, discount_applied: 0.0, discount_rate: 0.0) if hash.nil? hash = hash.transform_keys(&:to_s) new( enabled: hash["enabled"] || false, discount_applied: (hash["discount_applied"] || 0.0).to_f, discount_rate: (hash["discount_rate"] || 0.0).to_f ) end |