Class: OBIX::Types::Duration
Instance Method Summary collapse
-
#cast(value) ⇒ Object
Cast the given value to an integer describing seconds.
Methods inherited from Type
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 |