Class: Yao::Resources::Flavor

Inherits:
Base
  • Object
show all
Defined in:
lib/yao/resources/flavor.rb

Instance Attribute Summary

Attributes included from RestfullyAccessible

#service

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#[], #[]=, #created, friendly_attributes, #id, #initialize, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, #updated

Methods included from RestfullyAccessible

#admin=, #api_version, #api_version=, #as_member, #client, #create, #destroy, extended, #find_by_name, #get, #list, #resources_path, #resources_path=, #return_single_on_querying=, #update, #with_resources_path

Constructor Details

This class inherits a constructor from Yao::Resources::Base

Class Method Details

.list_detail(query = {}) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/yao/resources/flavor.rb', line 22

def list_detail(query={})
  return_resources(
    resources_from_json(
      GET([resources_path, "detail"].join("/"), query).body
    )
  )
end

Instance Method Details

#ram(unit = 'M') ⇒ Object Also known as: memory



7
8
9
10
11
12
13
14
# File 'lib/yao/resources/flavor.rb', line 7

def ram(unit='M')
  case unit
  when 'M'
    self["ram"]
  when 'G'
    self["ram"] / 1024.0
  end
end