Class: Realm
Instance Attribute Summary collapse
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#name ⇒ Object
Returns the value of attribute name.
-
#resource_types ⇒ Object
Returns the value of attribute resource_types.
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(init = nil) ⇒ Realm
constructor
A new instance of Realm.
- #to_hash(context) ⇒ Object
Methods inherited from BaseModel
attr_accessor, attributes, #attributes, #id, #to_entity
Constructor Details
#initialize(init = nil) ⇒ Realm
Returns a new instance of Realm.
25 26 27 28 |
# File 'lib/deltacloud/models/realm.rb', line 25 def initialize(init=nil) super(init) self.resource_types ||= [] end |
Instance Attribute Details
#limit ⇒ Object
Returns the value of attribute limit.
21 22 23 |
# File 'lib/deltacloud/models/realm.rb', line 21 def limit @limit end |
#name ⇒ Object
Returns the value of attribute name.
20 21 22 |
# File 'lib/deltacloud/models/realm.rb', line 20 def name @name end |
#resource_types ⇒ Object
Returns the value of attribute resource_types.
23 24 25 |
# File 'lib/deltacloud/models/realm.rb', line 23 def resource_types @resource_types end |
#state ⇒ Object
Returns the value of attribute state.
22 23 24 |
# File 'lib/deltacloud/models/realm.rb', line 22 def state @state end |
Instance Method Details
#to_hash(context) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/deltacloud/models/realm.rb', line 30 def to_hash(context) r = { :id => self.id, :href => context.realm_url(self.id), :name => name, :state => state, :limit => limit } r.merge!({:resource_types => resource_types}) if resource_types r end |