Class: Tanuki_Attribute

Inherits:
Object show all
Defined in:
app/tanuki/attribute/attribute.rb

Instance Method Summary collapse

Constructor Details

#initialize(cfg, owner) ⇒ Tanuki_Attribute

Returns a new instance of Tanuki_Attribute.



2
3
4
5
6
7
8
9
10
# File 'app/tanuki/attribute/attribute.rb', line 2

def initialize(cfg, owner)
  #--
  # created on demand (first access)
  # cfg is a parsed yaml hash
  # attribute owner object
  # all Object and Collection attrs are defined in relations
  @cfg = cfg
  @owner = owner
end

Instance Method Details

#required?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/tanuki/attribute/attribute.rb', line 12

def required?
  @cfg[:required]
end

#valueObject



16
17
18
# File 'app/tanuki/attribute/attribute.rb', line 16

def value
  # value of data (scalar, array, or hash)
end