Sha256: dddaae59c26eb7016e9a8d6e43233632c77c659c9b35514fd5e5343b19290e8f

Contents?: true

Size: 562 Bytes

Versions: 11

Compression:

Stored size: 562 Bytes

Contents

require 'blankslate'

module Mida
  module DataType

    # The base DataType Parser
    class Generic < BlankSlate
      
      # Convenience method, same as +new+
      def self.parse(value)
        self.new(value)
      end

      def method_missing(name, *args, &block)
        @parsedValue.send(name, *args, &block)
      end

      def to_s
        @parsedValue.to_s
      end

      def to_yaml(options={})
        to_s.to_yaml(options)
      end

      def ==(other)
        @parsedValue.to_s.downcase == other.to_s.downcase
      end

    end

  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
mida-0.3.9 lib/mida/datatype/generic.rb
mida_vocabulary-0.2.2 lib/mida_vocabulary/datatype/generic.rb
mida_vocabulary-0.2 lib/mida_vocabulary/datatype/generic.rb
mida-0.3.8 lib/mida/datatype/generic.rb
mida-0.3.7 lib/mida/datatype/generic.rb
mida-0.3.6 lib/mida/datatype/generic.rb
mida_vocabulary-0.1.3 lib/mida_vocabulary/datatype/generic.rb
mida_vocabulary-0.1.2 lib/mida_vocabulary/datatype/generic.rb
mida_vocabulary-0.1.1 lib/mida_vocabulary/datatype/generic.rb
mida_vocabulary-0.1 lib/mida_vocabulary/datatype/generic.rb
mida-0.3.3 lib/mida/datatype/generic.rb