Class: Mida::DataType::Generic

Inherits:
BlankSlate
  • Object
show all
Defined in:
lib/mida_vocabulary/datatype/generic.rb

Overview

The base DataType Parser

Direct Known Subclasses

Boolean, Enumeration, Float, ISO8601Date, Integer, Number, Text, Time, 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



14
15
16
# File 'lib/mida_vocabulary/datatype/generic.rb', line 14

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

Class Method Details

.parse(value) ⇒ Object

Convenience method, same as new



10
11
12
# File 'lib/mida_vocabulary/datatype/generic.rb', line 10

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

Instance Method Details

#==(other) ⇒ Object



26
27
28
# File 'lib/mida_vocabulary/datatype/generic.rb', line 26

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

#to_sObject



18
19
20
# File 'lib/mida_vocabulary/datatype/generic.rb', line 18

def to_s
  @parsedValue.to_s
end

#to_yaml(options = {}) ⇒ Object



22
23
24
# File 'lib/mida_vocabulary/datatype/generic.rb', line 22

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