Class: Mida::DataType::Generic

Inherits:
BasicObject
Defined in:
lib/mida/datatype/generic.rb

Overview

The base DataType Parser

Direct Known Subclasses

Boolean, Enumeration, Float, ISO8601Date, Integer, Number, Text, URL

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



12
13
14
# File 'lib/mida/datatype/generic.rb', line 12

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

Class Method Details

.parse(value) ⇒ Object

Convenience method, same as new



8
9
10
# File 'lib/mida/datatype/generic.rb', line 8

def self.parse(value)
  self.new(value)
end

Instance Method Details

#==(other) ⇒ Object



24
25
26
# File 'lib/mida/datatype/generic.rb', line 24

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

#to_sObject



16
17
18
# File 'lib/mida/datatype/generic.rb', line 16

def to_s
  @parsedValue.to_s
end

#to_yaml(options = {}) ⇒ Object



20
21
22
# File 'lib/mida/datatype/generic.rb', line 20

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