Class: RackspaceCloud::Flavor
- Inherits:
-
Object
- Object
- RackspaceCloud::Flavor
- Defined in:
- lib/rackspace_cloud/flavor.rb
Instance Attribute Summary collapse
-
#disk ⇒ Object
readonly
Returns the value of attribute disk.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#rackspace_id ⇒ Object
readonly
Returns the value of attribute rackspace_id.
-
#ram ⇒ Object
readonly
Returns the value of attribute ram.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(flavor_json) ⇒ Flavor
constructor
A new instance of Flavor.
- #to_i ⇒ Object
Constructor Details
#initialize(flavor_json) ⇒ Flavor
Returns a new instance of Flavor.
11 12 13 14 15 16 |
# File 'lib/rackspace_cloud/flavor.rb', line 11 def initialize(flavor_json) @rackspace_id = flavor_json['id'] @name = flavor_json['name'] @disk = flavor_json['disk'] @ram = flavor_json['ram'] end |
Instance Attribute Details
#disk ⇒ Object (readonly)
Returns the value of attribute disk.
3 4 5 |
# File 'lib/rackspace_cloud/flavor.rb', line 3 def disk @disk end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/rackspace_cloud/flavor.rb', line 3 def name @name end |
#rackspace_id ⇒ Object (readonly)
Returns the value of attribute rackspace_id.
3 4 5 |
# File 'lib/rackspace_cloud/flavor.rb', line 3 def rackspace_id @rackspace_id end |
#ram ⇒ Object (readonly)
Returns the value of attribute ram.
3 4 5 |
# File 'lib/rackspace_cloud/flavor.rb', line 3 def ram @ram end |
Class Method Details
.lookup_by_id(id) ⇒ Object
6 7 8 |
# File 'lib/rackspace_cloud/flavor.rb', line 6 def lookup_by_id(id) RackspaceCloud::FLAVORS[id] end |
Instance Method Details
#to_i ⇒ Object
18 19 20 |
# File 'lib/rackspace_cloud/flavor.rb', line 18 def to_i @rackspace_id end |