Class: Ivy::Serializers::Serializer
- Inherits:
-
Object
- Object
- Ivy::Serializers::Serializer
- Defined in:
- lib/ivy/serializers/serializer.rb
Class Attribute Summary collapse
-
._registry ⇒ Object
Returns the value of attribute _registry.
Class Method Summary collapse
- .attributes(generator, resource) ⇒ Object
- .inherited(base) ⇒ Object
- .map(klass, &block) ⇒ Object
- .relationships(generator, resource) ⇒ Object
- .resource(generator, resource) ⇒ Object
Instance Method Summary collapse
- #attributes(generator, resource) ⇒ Object
- #relationships(generator, resource) ⇒ Object
- #resource(generator, resource) ⇒ Object
Class Attribute Details
._registry ⇒ Object
Returns the value of attribute _registry.
7 8 9 |
# File 'lib/ivy/serializers/serializer.rb', line 7 def _registry @_registry end |
Class Method Details
.attributes(generator, resource) ⇒ Object
9 10 11 |
# File 'lib/ivy/serializers/serializer.rb', line 9 def attributes(generator, resource) _registry.attributes(generator, resource) end |
.inherited(base) ⇒ Object
13 14 15 |
# File 'lib/ivy/serializers/serializer.rb', line 13 def inherited(base) base._registry = Registry.new end |
.map(klass, &block) ⇒ Object
21 22 23 |
# File 'lib/ivy/serializers/serializer.rb', line 21 def map(klass, &block) _registry.map(klass, &block) end |
.relationships(generator, resource) ⇒ Object
17 18 19 |
# File 'lib/ivy/serializers/serializer.rb', line 17 def relationships(generator, resource) _registry.relationships(generator, resource) end |
.resource(generator, resource) ⇒ Object
25 26 27 |
# File 'lib/ivy/serializers/serializer.rb', line 25 def resource(generator, resource) _registry.resource(generator, resource) end |
Instance Method Details
#attributes(generator, resource) ⇒ Object
30 31 32 |
# File 'lib/ivy/serializers/serializer.rb', line 30 def attributes(generator, resource) self.class.attributes(generator, resource) end |
#relationships(generator, resource) ⇒ Object
34 35 36 |
# File 'lib/ivy/serializers/serializer.rb', line 34 def relationships(generator, resource) self.class.relationships(generator, resource) end |
#resource(generator, resource) ⇒ Object
38 39 40 |
# File 'lib/ivy/serializers/serializer.rb', line 38 def resource(generator, resource) self.class.resource(generator, resource) end |