Class: TimePatterns::NumberToken

Inherits:
Object
  • Object
show all
Defined in:
lib/todo_time_patterns/tokens.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, start_index) ⇒ NumberToken

Returns a new instance of NumberToken.



22
23
24
25
# File 'lib/todo_time_patterns/tokens.rb', line 22

def initialize(value, start_index)
  @value = Integer(value)
  @start_index = start_index
end

Instance Attribute Details

#start_indexObject (readonly)

Returns the value of attribute start_index.



20
21
22
# File 'lib/todo_time_patterns/tokens.rb', line 20

def start_index
  @start_index
end

#valueObject (readonly)

Returns the value of attribute value.



19
20
21
# File 'lib/todo_time_patterns/tokens.rb', line 19

def value
  @value
end

Instance Method Details

#to_sObject



27
28
29
# File 'lib/todo_time_patterns/tokens.rb', line 27

def to_s
  "{number}"
end