Class: Joyent::Cloud::Pricing::Flavor
- Inherits:
-
Object
- Object
- Joyent::Cloud::Pricing::Flavor
- Defined in:
- lib/pricing/flavor.rb
Instance Attribute Summary collapse
-
#cost ⇒ Object
Returns the value of attribute cost.
-
#cpus ⇒ Object
Returns the value of attribute cpus.
-
#disk ⇒ Object
Returns the value of attribute disk.
-
#name ⇒ Object
Returns the value of attribute name.
-
#os ⇒ Object
Returns the value of attribute os.
-
#ram ⇒ Object
Returns the value of attribute ram.
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ Flavor
constructor
A new instance of Flavor.
- #to_h ⇒ Object
Constructor Details
#initialize(name, options = {}) ⇒ Flavor
Returns a new instance of Flavor.
4 5 6 7 8 9 10 11 |
# File 'lib/pricing/flavor.rb', line 4 def initialize(name, = {}) @name = name @os = [:os] @cost = ([:cost] == 'N/A') ? nil : [:cost].to_f @cpus = [:cpus].to_f @disk = [:disk].to_i @ram = [:ram].to_f end |
Instance Attribute Details
#cost ⇒ Object
Returns the value of attribute cost.
3 4 5 |
# File 'lib/pricing/flavor.rb', line 3 def cost @cost end |
#cpus ⇒ Object
Returns the value of attribute cpus.
3 4 5 |
# File 'lib/pricing/flavor.rb', line 3 def cpus @cpus end |
#disk ⇒ Object
Returns the value of attribute disk.
3 4 5 |
# File 'lib/pricing/flavor.rb', line 3 def disk @disk end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/pricing/flavor.rb', line 3 def name @name end |
#os ⇒ Object
Returns the value of attribute os.
3 4 5 |
# File 'lib/pricing/flavor.rb', line 3 def os @os end |
#ram ⇒ Object
Returns the value of attribute ram.
3 4 5 |
# File 'lib/pricing/flavor.rb', line 3 def ram @ram end |
Instance Method Details
#to_h ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/pricing/flavor.rb', line 13 def to_h { name: name, os: os, cost: cost, cpus: cpus, disk: disk, ram: ram } end |