Class: Representable::Decorator
- Inherits:
-
Object
- Object
- Representable::Decorator
- Extended by:
- Uber::InheritableAttr
- Includes:
- Representable, Cached
- Defined in:
- lib/representable/decorator.rb
Constant Summary
Constants included from Representable
As, AssignAs, AssignFragment, AssignName, Decorate, Default, Deserialize, Deserializer, FindOrInstantiate, GetValue, Getter, If, OverwriteOnNil, ParseFilter, Prepare, ReadFragment, Reader, RenderDefault, RenderFilter, Serialize, Serializer, SetValue, Setter, SkipParse, SkipRender, Stop, StopOnExcluded, StopOnNil, StopOnNotFound, StopOnSkipable, VERSION, WriteFragment, Writer
Instance Attribute Summary collapse
-
#represented ⇒ Object
(also: #decorated)
readonly
Returns the value of attribute represented.
Class Method Summary collapse
-
.clone ⇒ Object
This is called from inheritable_attr when inheriting a decorator class to a subclass.
-
.default_nested_class ⇒ Object
FIXME.
- .nested_builder ⇒ Object
-
.prepare(represented) ⇒ Object
TODO: when moving all class methods into ClassMethods, i get a segfault.
Instance Method Summary collapse
-
#initialize(represented) ⇒ Decorator
constructor
A new instance of Decorator.
Methods included from Cached
Methods included from Representable
Constructor Details
#initialize(represented) ⇒ Decorator
Returns a new instance of Decorator.
33 34 35 |
# File 'lib/representable/decorator.rb', line 33 def initialize(represented) @represented = represented end |
Instance Attribute Details
#represented ⇒ Object (readonly) Also known as: decorated
Returns the value of attribute represented.
6 7 8 |
# File 'lib/representable/decorator.rb', line 6 def represented @represented end |
Class Method Details
.clone ⇒ Object
This is called from inheritable_attr when inheriting a decorator class to a subclass. Explicitly subclassing the Decorator makes sure representable_attrs is a clean version.
22 23 24 |
# File 'lib/representable/decorator.rb', line 22 def self.clone Class.new(self) end |
.default_nested_class ⇒ Object
FIXME. SHOULD we move that into NestedBuilder?
14 15 16 |
# File 'lib/representable/decorator.rb', line 14 def self.default_nested_class #FIXME. SHOULD we move that into NestedBuilder? Representable::Decorator end |
.nested_builder ⇒ Object
37 38 39 |
# File 'lib/representable/decorator.rb', line 37 def self.nested_builder ::Declarative::Schema::DSL::NestedBuilder end |
.prepare(represented) ⇒ Object
TODO: when moving all class methods into ClassMethods, i get a segfault.
10 11 12 |
# File 'lib/representable/decorator.rb', line 10 def self.prepare(represented) new(represented) end |