Class: Ivy::Serializers::Serializer

Inherits:
Object
  • Object
show all
Defined in:
lib/ivy/serializers/serializer.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

._registryObject

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