Class: VORuby::Resources::VOResource::V1_0::UTCTimestamp

Inherits:
Object
  • Object
show all
Includes:
XML::Mapping
Defined in:
lib/voruby/resources/voresource/voresource_v1_0.rb,
lib/voruby/resources/voresource/voresource_v1_0.rb

Overview

A timestamp that is compliant with ISO8601 but disallows the use of a timezone indicator.

Direct Known Subclasses

UTCDateTime

Instance Method Summary collapse

Instance Method Details

#value=(timestamp) ⇒ Object

Raises:

  • (RuntimeError)


220
221
222
223
224
# File 'lib/voruby/resources/voresource/voresource_v1_0.rb', line 220

def value=(timestamp)
  raise RuntimeError, "UTCTimestamp '#{timestamp} in wrong format" if !timestamp.strip.match('^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?$')

  @value = Time.parse(timestamp.strip)
end