Class: Settis::Serializer

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Serializer

Returns a new instance of Serializer.



33
34
35
# File 'lib/settis/serializer.rb', line 33

def initialize(type)
  @type = type
end

Class Method Details

.for(type) ⇒ Object



25
26
27
28
# File 'lib/settis/serializer.rb', line 25

def for(type)
  @serializers ||= []
  @serializers.detect {|s| s.serializes?(type) }
end

.inherited(subclass) ⇒ Object



20
21
22
23
# File 'lib/settis/serializer.rb', line 20

def inherited(subclass)
  @serializers ||= []
  @serializers << subclass
end

.serializes?(type) ⇒ Boolean

Returns:

  • (Boolean)


30
# File 'lib/settis/serializer.rb', line 30

def serializes?(type) ; false ; end