Class: Mida::DataType::Time

Inherits:
Generic
  • Object
show all
Defined in:
lib/mida_vocabulary/datatype/time.rb

Overview

ISO 8601 Date data type Provides access to DateTime methods

Instance Method Summary collapse

Methods inherited from Generic

#==, #method_missing, parse, #to_yaml

Constructor Details

#initialize(value) ⇒ Time

Raises ArgumentError if value not valid



12
13
14
15
16
# File 'lib/mida_vocabulary/datatype/time.rb', line 12

def initialize(value)
  @parsedValue = ::DateTime.parse(value)
rescue => e
  raise ArgumentError, e
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Mida::DataType::Generic

Instance Method Details

#to_sObject



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

def to_s
  @parsedValue.strftime("%I:%M%P")
end