Class: RackspaceCloud::Flavor

Inherits:
Object
  • Object
show all
Defined in:
lib/rackspace_cloud/flavor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flavor_json) ⇒ Flavor

Returns a new instance of Flavor.



5
6
7
8
9
10
# File 'lib/rackspace_cloud/flavor.rb', line 5

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

#diskObject (readonly)

Returns the value of attribute disk.



3
4
5
# File 'lib/rackspace_cloud/flavor.rb', line 3

def disk
  @disk
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/rackspace_cloud/flavor.rb', line 3

def name
  @name
end

#rackspace_idObject (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

#ramObject (readonly)

Returns the value of attribute ram.



3
4
5
# File 'lib/rackspace_cloud/flavor.rb', line 3

def ram
  @ram
end

Instance Method Details

#to_iObject



12
13
14
# File 'lib/rackspace_cloud/flavor.rb', line 12

def to_i
  @rackspace_id
end