Class: Eventual::Year

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#valueObject



21
22
23
24
25
26
# File 'lib/eventual/syntax_nodes.rb', line 21

def value
  match  = text_value.match(/(')?(\d{2,4})/)
  value  = match[2].to_i
  value += 2000 if match[1]
  value
end