Class: Disposable::Twin::Decorator

Inherits:
Representable::Decorator
  • Object
show all
Includes:
AllowSymbols, Representable::Hash
Defined in:
lib/disposable/twin/representer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build_configObject



12
13
14
# File 'lib/disposable/twin/representer.rb', line 12

def self.build_config
  Config.new(Definition)
end

.cloneObject

DISCUSS: same in reform, is that a bug in represntable?



8
9
10
# File 'lib/disposable/twin/representer.rb', line 8

def self.clone # called in inheritable_attr :representer_class.
  Class.new(self) # By subclassing, representable_attrs.clone is called.
end

Instance Method Details

#twin_namesObject



16
17
18
19
20
# File 'lib/disposable/twin/representer.rb', line 16

def twin_names
  representable_attrs.
    find_all { |attr| attr[:twin] }.
    collect { |attr| attr.name.to_sym }
end