Class: OBIX::Types::Duration

Inherits:
Type
  • Object
show all
Defined in:
lib/obix/types/duration.rb

Instance Method Summary collapse

Methods inherited from Type

#initialize

Constructor Details

This class inherits a constructor from OBIX::Types::Type

Instance Method Details

#cast(value) ⇒ Object

Cast the given value to an integer describing seconds.

value - A String describing an XSD

Returns an Integer.



13
14
15
16
# File 'lib/obix/types/duration.rb', line 13

def cast value
  duration = RDF::Literal::Duration.new value
  duration.to_i
end