Class: SoftLayer::ProductConfigurationOption
- Inherits:
-
Struct
- Object
- Struct
- SoftLayer::ProductConfigurationOption
- Defined in:
- lib/softlayer/ProductItemCategory.rb
Overview
This struct represents a configuration option that can be included in a product order. Strictly speaking the only information required for the product order is the price_id, the rest of the information is provided to make the object friendly to humans who may be searching for the meaning of a given price_id.
Instance Attribute Summary collapse
-
#capacity ⇒ Object
Returns the value of attribute capacity.
-
#description ⇒ Object
Returns the value of attribute description.
-
#hourlyRecurringFee ⇒ Object
Returns the value of attribute hourlyRecurringFee.
-
#laborFee ⇒ Object
Returns the value of attribute laborFee.
-
#oneTimeFee ⇒ Object
Returns the value of attribute oneTimeFee.
-
#price_id ⇒ Object
Returns the value of attribute price_id.
-
#recurringFee ⇒ Object
Returns the value of attribute recurringFee.
-
#setupFee ⇒ Object
Returns the value of attribute setupFee.
-
#units ⇒ Object
Returns the value of attribute units.
Instance Method Summary collapse
-
#free? ⇒ Boolean
returns true if the configurtion option has no fees associated with it.
-
#initialize(package_item_data, price_item_data) ⇒ ProductConfigurationOption
constructor
Is it evil, or just incongruous to give methods to a struct?.
Constructor Details
#initialize(package_item_data, price_item_data) ⇒ ProductConfigurationOption
Is it evil, or just incongruous to give methods to a struct?
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def initialize(package_item_data, price_item_data) self.description = package_item_data['description'] self.capacity = package_item_data['capacity'] self.units = package_item_data['units'] self.price_id = price_item_data['id'] self.setupFee = price_item_data['setupFee'] ? price_item_data['setupFee'].to_f : 0.0 self.laborFee = price_item_data['laborFee'] ? price_item_data['laborFee'].to_f : 0.0 self.oneTimeFee = price_item_data['oneTimeFee'] ? price_item_data['oneTimeFee'].to_f : 0.0 self.recurringFee = price_item_data['recurringFee'] ? price_item_data['recurringFee'].to_f : 0.0 self.hourlyRecurringFee = price_item_data['hourlyRecurringFee'] ? price_item_data['hourlyRecurringFee'].to_f : 0.0 end |
Instance Attribute Details
#capacity ⇒ Object
Returns the value of attribute capacity
13 14 15 |
# File 'lib/softlayer/ProductItemCategory.rb', line 13 def capacity @capacity end |
#description ⇒ Object
Returns the value of attribute description
13 14 15 |
# File 'lib/softlayer/ProductItemCategory.rb', line 13 def description @description end |
#hourlyRecurringFee ⇒ Object
Returns the value of attribute hourlyRecurringFee
13 14 15 |
# File 'lib/softlayer/ProductItemCategory.rb', line 13 def hourlyRecurringFee @hourlyRecurringFee end |
#laborFee ⇒ Object
Returns the value of attribute laborFee
13 14 15 |
# File 'lib/softlayer/ProductItemCategory.rb', line 13 def laborFee @laborFee end |
#oneTimeFee ⇒ Object
Returns the value of attribute oneTimeFee
13 14 15 |
# File 'lib/softlayer/ProductItemCategory.rb', line 13 def oneTimeFee @oneTimeFee end |
#price_id ⇒ Object
Returns the value of attribute price_id
13 14 15 |
# File 'lib/softlayer/ProductItemCategory.rb', line 13 def price_id @price_id end |
#recurringFee ⇒ Object
Returns the value of attribute recurringFee
13 14 15 |
# File 'lib/softlayer/ProductItemCategory.rb', line 13 def recurringFee @recurringFee end |
#setupFee ⇒ Object
Returns the value of attribute setupFee
13 14 15 |
# File 'lib/softlayer/ProductItemCategory.rb', line 13 def setupFee @setupFee end |
#units ⇒ Object
Returns the value of attribute units
13 14 15 |
# File 'lib/softlayer/ProductItemCategory.rb', line 13 def units @units end |
Instance Method Details
#free? ⇒ Boolean
returns true if the configurtion option has no fees associated with it.
31 32 33 |
# File 'lib/softlayer/ProductItemCategory.rb', line 31 def free? self.setupFee == 0 && self.laborFee == 0 && self.oneTimeFee == 0 && self.recurringFee == 0 && self.hourlyRecurringFee == 0 end |