Class: Relaton::Bib::StringDate

Inherits:
Lutaml::Model::Type::Value
  • Object
show all
Defined in:
lib/relaton/bib/model/type/string_date.rb

Defined Under Namespace

Classes: Value

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.cast(value) ⇒ Object



36
37
38
39
40
41
# File 'lib/relaton/bib/model/type/string_date.rb', line 36

def self.cast(value)
  case value
  when Value then value
  when String then Value.parse_date(value)
  end
end

Instance Method Details

#to_yamlObject



43
44
45
# File 'lib/relaton/bib/model/type/string_date.rb', line 43

def to_yaml
  value.to_s
end