Sha256: 63bc0b5d1b6d82217fd9bb3a71182668f48eae3671c9478fc43304cbcd3cd88f

Contents?: true

Size: 510 Bytes

Versions: 6

Compression:

Stored size: 510 Bytes

Contents

module Transcriber
  class Resource
    class Property < Key
      include Parser::Property
      include Response::Property

      attr_accessor :serializer
      attr_accessor :translations

      def initialize(name, options = {})
        super
        @serializer   = options.fetch(:type, Serialization::String)
        @translations = options[:values]        if options[:values].kind_of?(Proc)
        @translations = options[:values].invert if options[:values].kind_of?(Hash)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
transcriber-0.0.8 lib/transcriber/resource/key/property.rb
transcriber-0.0.7 lib/transcriber/resource/key/property.rb
transcriber-0.0.6 lib/transcriber/resource/key/property.rb
transcriber-0.0.5 lib/transcriber/resource/key/property.rb
transcriber-0.0.4 lib/transcriber/resource/key/property.rb
transcriber-0.0.3 lib/transcriber/resource/key/property.rb