Class: Occi::Core::Attribute

Inherits:
AttributeProperty show all
Defined in:
lib/occi/core/attribute.rb

Instance Attribute Summary collapse

Attributes inherited from AttributeProperty

#_default, #_description, #_mutable, #_pattern, #_required, #_type

Instance Method Summary collapse

Methods inherited from AttributeProperty

#as_json, #mutable?, #required?

Constructor Details

#initialize(properties = {}) ⇒ Attribute


9
10
11
12
13
14
15
16
17
# File 'lib/occi/core/attribute.rb', line 9

def initialize(properties={})
  case properties
    when Occi::Core::AttributeProperty
      self._value = properties._value if properties.respond_to?('_value')
    else
      self._value = properties[:value] if properties[:value]
  end
  super(properties)
end

Instance Attribute Details

#_valueObject

Returns the value of attribute _value


5
6
7
# File 'lib/occi/core/attribute.rb', line 5

def _value
  @_value
end

Instance Method Details

#inspectObject


35
36
37
# File 'lib/occi/core/attribute.rb', line 35

def inspect
  self._value
end