Class: ShellDataReportingApIs::FeeRuleTier
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::FeeRuleTier
- Defined in:
- lib/shell_data_reporting_ap_is/models/fee_rule_tier.rb
Overview
FeeRuleTier Model.
Instance Attribute Summary collapse
-
#tier_maximum ⇒ Integer
Maximum consumption configured in the tier.
-
#tier_minimum ⇒ Integer
Minimum consumption configured in the tier.
-
#value ⇒ Float
Bonus value for the tier.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(tier_minimum = SKIP, value = SKIP, tier_maximum = SKIP) ⇒ FeeRuleTier
constructor
A new instance of FeeRuleTier.
Methods inherited from BaseModel
Constructor Details
#initialize(tier_minimum = SKIP, value = SKIP, tier_maximum = SKIP) ⇒ FeeRuleTier
Returns a new instance of FeeRuleTier.
51 52 53 54 55 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_tier.rb', line 51 def initialize(tier_minimum = SKIP, value = SKIP, tier_maximum = SKIP) @tier_minimum = tier_minimum unless tier_minimum == SKIP @value = value unless value == SKIP @tier_maximum = tier_maximum unless tier_maximum == SKIP end |
Instance Attribute Details
#tier_maximum ⇒ Integer
Maximum consumption configured in the tier.
22 23 24 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_tier.rb', line 22 def tier_maximum @tier_maximum end |
#tier_minimum ⇒ Integer
Minimum consumption configured in the tier.
14 15 16 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_tier.rb', line 14 def tier_minimum @tier_minimum end |
#value ⇒ Float
Bonus value for the tier.
18 19 20 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_tier.rb', line 18 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_tier.rb', line 58 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. tier_minimum = hash.key?('TierMinimum') ? hash['TierMinimum'] : SKIP value = hash.key?('Value') ? hash['Value'] : SKIP tier_maximum = hash.key?('TierMaximum') ? hash['TierMaximum'] : SKIP # Create object from extracted values. FeeRuleTier.new(tier_minimum, value, tier_maximum) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_tier.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['tier_minimum'] = 'TierMinimum' @_hash['value'] = 'Value' @_hash['tier_maximum'] = 'TierMaximum' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 46 47 48 49 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_tier.rb', line 43 def self.nullables %w[ tier_minimum value tier_maximum ] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 40 |
# File 'lib/shell_data_reporting_ap_is/models/fee_rule_tier.rb', line 34 def self.optionals %w[ tier_minimum value tier_maximum ] end |