class Gearhead::Serializers::Lookup

Attributes

adapter_name[R]

Public Class Methods

for(type, adapter_name = ::Gearhead.config.serialization.adapter) click to toggle source
# File lib/gearhead/serializers/lookup.rb, line 4
def self.for(type, adapter_name = ::Gearhead.config.serialization.adapter)
  new(type, adapter_name).serializer
end
new(type, adapter_name) click to toggle source
# File lib/gearhead/serializers/lookup.rb, line 9
def initialize(type, adapter_name)
  @type = type.to_s
  @adapter_name = adapter_name
end

Public Instance Methods

serializer() click to toggle source
# File lib/gearhead/serializers/lookup.rb, line 14
def serializer
  "::Gearhead::Serializers::#{adapter}::#{@type.classify}Serializer".constantize
end

Private Instance Methods

adapter() click to toggle source
# File lib/gearhead/serializers/lookup.rb, line 20
def adapter
  adapter_name.to_s.camelcase
end