Class: Eventual::Time
- Inherits:
-
Treetop::Runtime::SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- Eventual::Time
- Defined in:
- lib/eventual/syntax_nodes.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#hour ⇒ Object
214 |
# File 'lib/eventual/syntax_nodes.rb', line 214 def hour; value.first end |
#minute ⇒ Object
215 |
# File 'lib/eventual/syntax_nodes.rb', line 215 def minute; value[1] || 0 end |
#to_i ⇒ Object
217 218 219 |
# File 'lib/eventual/syntax_nodes.rb', line 217 def to_i ("%02d%02d" % [hour, minute]).to_i end |
#value ⇒ Object
210 211 212 |
# File 'lib/eventual/syntax_nodes.rb', line 210 def value @value ||= text_value.scan(/\d+/).map(&:to_i) end |