Class: KDL::Types::Date

Inherits:
Value
  • Object
show all
Defined in:
lib/kdl/types/date_time.rb

Constant Summary

Constants inherited from Value

Value::Null

Instance Attribute Summary

Attributes inherited from Value

#format, #type, #value

Class Method Summary collapse

Methods inherited from Value

#as_type, from, #initialize, #stringify_value, #to_s

Constructor Details

This class inherits a constructor from KDL::Value

Class Method Details

.call(value, type = 'date') ⇒ Object



32
33
34
35
36
37
# File 'lib/kdl/types/date_time.rb', line 32

def self.call(value, type = 'date')
  return nil unless value.is_a? ::KDL::Value::String

  date = ::Date.iso8601(value.value)
  new(date, type: type)
end