Class: Disposable::Twin::Decorator
- Inherits:
-
Representable::Decorator
- Object
- Representable::Decorator
- Disposable::Twin::Decorator
- Defined in:
- lib/disposable/twin/representer.rb
Defined Under Namespace
Classes: Definition, Options
Class Method Summary collapse
-
.build_config ⇒ Object
FIXME: this is not properly used when inheriting - fix that in representable.
- .default_inline_class ⇒ Object
- .each(options = {}) ⇒ Object
Class Method Details
.build_config ⇒ Object
FIXME: this is not properly used when inheriting - fix that in representable.
19 20 21 |
# File 'lib/disposable/twin/representer.rb', line 19 def self.build_config Config.new(Definition) end |
.default_inline_class ⇒ Object
40 41 42 |
# File 'lib/disposable/twin/representer.rb', line 40 def self.default_inline_class Twin end |
.each(options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/disposable/twin/representer.rb', line 23 def self.each(={}) return representable_attrs[:definitions].values unless block_given? definitions = representable_attrs definitions.each do |dfn| next if [:exclude] and [:exclude].include?(dfn.name) next if [:scalar] and dfn[:collection] next if [:collection] and ! dfn[:collection] next if [:twin] and ! dfn[:twin] yield dfn end definitions end |