Class: Fog::Vcloud::Model
- Defined in:
- lib/rackspace-fog/vcloud/compute.rb
Direct Known Subclasses
Compute::Catalog, Compute::CatalogItem, Compute::Ip, Compute::Network, Compute::Organization, Compute::Server, Compute::Task, Compute::Vapp, Compute::Vdc
Instance Attribute Summary collapse
-
#loaded ⇒ Object
(also: #loaded?)
Returns the value of attribute loaded.
Attributes inherited from Model
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Model
#initialize, #inspect, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Model
Instance Attribute Details
#loaded ⇒ Object Also known as: loaded?
Returns the value of attribute loaded.
40 41 42 |
# File 'lib/rackspace-fog/vcloud/compute.rb', line 40 def loaded @loaded end |
Class Method Details
.has_up(item) ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/rackspace-fog/vcloud/compute.rb', line 60 def self.has_up(item) class_eval <<-EOS, __FILE__,__LINE__ def #{item} load_unless_loaded! connection.get_#{item}(link_up[:href]) end EOS end |
Instance Method Details
#link_up ⇒ Object
55 56 57 58 |
# File 'lib/rackspace-fog/vcloud/compute.rb', line 55 def link_up load_unless_loaded! self.links.find{|l| l[:rel] == 'up' } end |
#load_unless_loaded! ⇒ Object
49 50 51 52 53 |
# File 'lib/rackspace-fog/vcloud/compute.rb', line 49 def load_unless_loaded! unless @loaded reload end end |
#reload ⇒ Object
43 44 45 46 47 |
# File 'lib/rackspace-fog/vcloud/compute.rb', line 43 def reload instance = super @loaded = true instance end |