Sha256: d50be0d379d00e30968e2a19f2af2904a8b7af8284c354f66402fb475a6c9587
Contents?: true
Size: 1.04 KB
Versions: 1
Compression:
Stored size: 1.04 KB
Contents
# encoding: UTF-8 module Rosette module Core # Logic for handling serializer ids. Serializer ids are strings that refer to # a particular serializer class. For example, the id 'yaml/rails' refers to # +Rosette::Serializers::YamlSerializer::RailsSerializer+. # # @example # SerializerId.resolve('yaml/rails') # # => Rosette::Serializers::YamlSerializer::RailsSerializer class SerializerId < Resolver class << self # Parses and identifies the class constant for the given serializer id. # # @param [Class, String] serializer_id When given a class, returns the # class. When given a string, parses and identifies the corresponding # class constant in +namespace+. # @param [Class] namespace The namespace to look in. # @return [Class] The identified class constant. def resolve(serializer_id, namespace = Rosette::Serializers) super end private def suffix 'Serializer' end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rosette-core-1.0.1 | lib/rosette/core/resolvers/serializer_id.rb |