1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/vcloudng/models/compute/organization.rb
2013-07-08 20:54:54 +02:00

51 lines
No EOL
1.1 KiB
Ruby

require 'fog/core/model'
module Fog
module Compute
class Vcloudng
class Organization < Fog::Model
identity :id
attribute :name, :aliases => :FullName
attribute :type
attribute :href
attribute :description, :aliases => :Description
def vdcs
requires :id
service.vdcs(:organization => self)
end
def catalogs
requires :id
service.catalogs(:organization => self)
end
def networks
requires :id
service.networks(:organization => self)
end
def initialize(attrs={})
super(attrs)
[:description].each { |attr| attributes[attr]= NonLoaded if attributes[attr].nil? }
end
def description
reload if attributes[:description] == NonLoaded and !@inspecting
attributes[:description]
end
def inspect
@inspecting = true
out = super
@inspecting = false
out
end
end
end
end
end