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.
DEPRECATION WARNING: The following configuration option keys have been deprecated and will be removed with the next major version: capacityRestrictionMaximum, capacityRestrictionMinimum, capacityRestrictionType, hourlyRecurringFee, laborFee, oneTimeFee, recurringFee, requiredCoreCount, setupFee
Instance Attribute Summary collapse
-
#capacity ⇒ Object
Returns the value of attribute capacity.
-
#capacity_restriction_maximum ⇒ Object
Returns the value of attribute capacity_restriction_maximum.
-
#capacity_restriction_minimum ⇒ Object
Returns the value of attribute capacity_restriction_minimum.
-
#capacity_restriction_type ⇒ Object
Returns the value of attribute capacity_restriction_type.
-
#capacityRestrictionMaximum ⇒ Object
Returns the value of attribute capacityRestrictionMaximum.
-
#capacityRestrictionMinimum ⇒ Object
Returns the value of attribute capacityRestrictionMinimum.
-
#capacityRestrictionType ⇒ Object
Returns the value of attribute capacityRestrictionType.
-
#description ⇒ Object
Returns the value of attribute description.
-
#hourly_recurring_fee ⇒ Object
Returns the value of attribute hourly_recurring_fee.
-
#hourlyRecurringFee ⇒ Object
Returns the value of attribute hourlyRecurringFee.
-
#labor_fee ⇒ Object
Returns the value of attribute labor_fee.
-
#laborFee ⇒ Object
Returns the value of attribute laborFee.
-
#one_time_fee ⇒ Object
Returns the value of attribute one_time_fee.
-
#oneTimeFee ⇒ Object
Returns the value of attribute oneTimeFee.
-
#price_id ⇒ Object
Returns the value of attribute price_id.
-
#recurring_fee ⇒ Object
Returns the value of attribute recurring_fee.
-
#recurringFee ⇒ Object
Returns the value of attribute recurringFee.
-
#required_core_count ⇒ Object
Returns the value of attribute required_core_count.
-
#requiredCoreCount ⇒ Object
Returns the value of attribute requiredCoreCount.
-
#setup_fee ⇒ Object
Returns the value of attribute setup_fee.
-
#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 configuration 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?
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/softlayer/ProductItemCategory.rb', line 23 def initialize(package_item_data, price_item_data) self.capacity = package_item_data['capacity'] self.description = package_item_data['description'] self.units = package_item_data['units'] #DEPRECATION WARNING: All these are deprecated and will be removed with the next major version, pleace use keys below self.capacityRestrictionMaximum = price_item_data['capacityRestrictionMaximum'] ? price_item_data['capacityRestrictionMaximum'] : nil self.capacityRestrictionMinimum = price_item_data['capacityRestrictionMinimum'] ? price_item_data['capacityRestrictionMinimum'] : nil self.capacityRestrictionType = price_item_data['capacityRestrictionType'] ? price_item_data['capacityRestrictionType'] : nil self.hourlyRecurringFee = price_item_data['hourlyRecurringFee'] ? price_item_data['hourlyRecurringFee'].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.price_id = price_item_data['id'] self.recurringFee = price_item_data['recurringFee'] ? price_item_data['recurringFee'].to_f : 0.0 self.requiredCoreCount = price_item_data['requiredCoreCount'] ? price_item_data['requiredCoreCount'] : nil self.setupFee = price_item_data['setupFee'] ? price_item_data['setupFee'].to_f : 0.0 self.capacity_restriction_maximum = price_item_data['capacityRestrictionMaximum'] ? price_item_data['capacityRestrictionMaximum'] : nil self.capacity_restriction_minimum = price_item_data['capacityRestrictionMinimum'] ? price_item_data['capacityRestrictionMinimum'] : nil self.capacity_restriction_type = price_item_data['capacityRestrictionType'] ? price_item_data['capacityRestrictionType'] : nil self.hourly_recurring_fee = price_item_data['hourlyRecurringFee'] ? price_item_data['hourlyRecurringFee'].to_f : 0.0 self.labor_fee = price_item_data['laborFee'] ? price_item_data['laborFee'].to_f : 0.0 self.one_time_fee = price_item_data['oneTimeFee'] ? price_item_data['oneTimeFee'].to_f : 0.0 self.recurring_fee = price_item_data['recurringFee'] ? price_item_data['recurringFee'].to_f : 0.0 self.required_core_count = price_item_data['requiredCoreCount'] ? price_item_data['requiredCoreCount'] : nil self.setup_fee = price_item_data['setupFee'] ? price_item_data['setupFee'].to_f : 0.0 end |
Instance Attribute Details
#capacity ⇒ Object
Returns the value of attribute capacity
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def capacity @capacity end |
#capacity_restriction_maximum ⇒ Object
Returns the value of attribute capacity_restriction_maximum
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def capacity_restriction_maximum @capacity_restriction_maximum end |
#capacity_restriction_minimum ⇒ Object
Returns the value of attribute capacity_restriction_minimum
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def capacity_restriction_minimum @capacity_restriction_minimum end |
#capacity_restriction_type ⇒ Object
Returns the value of attribute capacity_restriction_type
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def capacity_restriction_type @capacity_restriction_type end |
#capacityRestrictionMaximum ⇒ Object
Returns the value of attribute capacityRestrictionMaximum
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def capacityRestrictionMaximum @capacityRestrictionMaximum end |
#capacityRestrictionMinimum ⇒ Object
Returns the value of attribute capacityRestrictionMinimum
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def capacityRestrictionMinimum @capacityRestrictionMinimum end |
#capacityRestrictionType ⇒ Object
Returns the value of attribute capacityRestrictionType
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def capacityRestrictionType @capacityRestrictionType end |
#description ⇒ Object
Returns the value of attribute description
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def description @description end |
#hourly_recurring_fee ⇒ Object
Returns the value of attribute hourly_recurring_fee
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def hourly_recurring_fee @hourly_recurring_fee end |
#hourlyRecurringFee ⇒ Object
Returns the value of attribute hourlyRecurringFee
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def hourlyRecurringFee @hourlyRecurringFee end |
#labor_fee ⇒ Object
Returns the value of attribute labor_fee
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def labor_fee @labor_fee end |
#laborFee ⇒ Object
Returns the value of attribute laborFee
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def laborFee @laborFee end |
#one_time_fee ⇒ Object
Returns the value of attribute one_time_fee
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def one_time_fee @one_time_fee end |
#oneTimeFee ⇒ Object
Returns the value of attribute oneTimeFee
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def oneTimeFee @oneTimeFee end |
#price_id ⇒ Object
Returns the value of attribute price_id
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def price_id @price_id end |
#recurring_fee ⇒ Object
Returns the value of attribute recurring_fee
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def recurring_fee @recurring_fee end |
#recurringFee ⇒ Object
Returns the value of attribute recurringFee
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def recurringFee @recurringFee end |
#required_core_count ⇒ Object
Returns the value of attribute required_core_count
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def required_core_count @required_core_count end |
#requiredCoreCount ⇒ Object
Returns the value of attribute requiredCoreCount
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def requiredCoreCount @requiredCoreCount end |
#setup_fee ⇒ Object
Returns the value of attribute setup_fee
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def setup_fee @setup_fee end |
#setupFee ⇒ Object
Returns the value of attribute setupFee
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def setupFee @setupFee end |
#units ⇒ Object
Returns the value of attribute units
17 18 19 |
# File 'lib/softlayer/ProductItemCategory.rb', line 17 def units @units end |
Instance Method Details
#free? ⇒ Boolean
returns true if the configuration option has no fees associated with it.
52 53 54 |
# File 'lib/softlayer/ProductItemCategory.rb', line 52 def free? self.setupFee == 0 && self.laborFee == 0 && self.oneTimeFee == 0 && self.recurringFee == 0 && self.hourlyRecurringFee == 0 end |