Sha256: 992b3f4950d871e95a274def32ff9f8a361e2e3a7ed01ae9a9fb9587131ef90e

Contents?: true

Size: 468 Bytes

Versions: 13

Compression:

Stored size: 468 Bytes

Contents

module Transcriber
  class Resource
    module Parser
      module Property
        def parse(value, resource = nil)
          translate(serializer.serialize(value), resource)
        end

        def translate(value, resource)
          case translations
          when nil
            value
          when Hash
            translations[value]
          when Proc
            resource.instance_eval &translations
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
transcriber-0.0.15 lib/transcriber/resource/parser/property.rb
transcriber-0.0.14 lib/transcriber/resource/parser/property.rb
transcriber-0.0.13 lib/transcriber/resource/parser/property.rb
transcriber-0.0.12 lib/transcriber/resource/parser/property.rb
transcriber-0.0.11 lib/transcriber/resource/parser/property.rb
transcriber-0.0.10 lib/transcriber/resource/parser/property.rb
transcriber-0.0.9 lib/transcriber/resource/parser/property.rb
transcriber-0.0.8 lib/transcriber/resource/parser/property.rb
transcriber-0.0.7 lib/transcriber/resource/parser/property.rb
transcriber-0.0.6 lib/transcriber/resource/parser/property.rb
transcriber-0.0.5 lib/transcriber/resource/parser/property.rb
transcriber-0.0.4 lib/transcriber/resource/parser/property.rb
transcriber-0.0.3 lib/transcriber/resource/parser/property.rb