Class: Mugatu::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/mugatu/attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, type, options = {}) ⇒ Attribute

Returns a new instance of Attribute.



5
6
7
8
9
# File 'lib/mugatu/attribute.rb', line 5

def initialize(key, type, options = {})
  @key       = key
  @type      = type
  self.value = options[:default_value] # nil when none is set.
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



3
4
5
# File 'lib/mugatu/attribute.rb', line 3

def key
  @key
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/mugatu/attribute.rb', line 3

def type
  @type
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/mugatu/attribute.rb', line 3

def value
  @value
end