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
-
.parse(value) ⇒ Object
Convenience method, same as
new.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #method_missing(name, *args, &block) ⇒ Object
- #to_s ⇒ Object
- #to_yaml(options = {}) ⇒ Object
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_s ⇒ Object
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(={}) to_s.to_yaml() end |