Class: Fog::Vcloud::Terremark::Ecloud::InternetServices

Inherits:
Collection show all
Defined in:
lib/fog/vcloud/terremark/ecloud/models/internet_services.rb

Instance Attribute Summary collapse

Attributes inherited from Collection

#connection

Instance Method Summary collapse

Methods inherited from Collection

#[], all_request, get_request, inherited, #reload, vcloud_type

Methods inherited from Collection

#create, #initialize, #inspect, #load, model, #model, #new, #reload, #table, #to_json

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #identity, #identity=, #merge_attributes, #new_record?, #requires

Constructor Details

This class inherits a constructor from Fog::Collection

Instance Attribute Details

#hrefObject

Returns the value of attribute href.



20
21
22
# File 'lib/fog/vcloud/terremark/ecloud/models/internet_services.rb', line 20

def href
  @href
end

Instance Method Details

#get(uri) ⇒ Object



27
28
29
30
31
32
# File 'lib/fog/vcloud/terremark/ecloud/models/internet_services.rb', line 27

def get(uri)
  if internet_service = get_raw(uri)
    item = new(:href => internet_service.href)
    item.reload
  end
end

#get_raw(uri) ⇒ Object



34
35
36
# File 'lib/fog/vcloud/terremark/ecloud/models/internet_services.rb', line 34

def get_raw(uri)
  raw_results.body.links.detect { |link| link.href == uri }
end

#raw_resultsObject



38
39
40
# File 'lib/fog/vcloud/terremark/ecloud/models/internet_services.rb', line 38

def raw_results
  @raw_results ||= connection.get_internet_services(self.href)
end