Class: Eventual::Time

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/eventual/syntax_nodes.rb

Overview

:nodoc:

Direct Known Subclasses

Time12, TimeRange

Instance Method Summary collapse

Instance Method Details

#hourObject



214
# File 'lib/eventual/syntax_nodes.rb', line 214

def hour; value.first end

#minuteObject



215
# File 'lib/eventual/syntax_nodes.rb', line 215

def minute; value[1] || 0 end

#to_iObject



217
218
219
# File 'lib/eventual/syntax_nodes.rb', line 217

def to_i
  ("%02d%02d" % [hour, minute]).to_i
end

#valueObject



210
211
212
# File 'lib/eventual/syntax_nodes.rb', line 210

def value
  @value ||= text_value.scan(/\d+/).map(&:to_i)
end