Class: TimePatterns::WordToken

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) ⇒ WordToken

Returns a new instance of WordToken.



8
9
10
11
# File 'lib/todo_time_patterns/tokens.rb', line 8

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

Instance Attribute Details

#start_indexObject (readonly)

Returns the value of attribute start_index.



6
7
8
# File 'lib/todo_time_patterns/tokens.rb', line 6

def start_index
  @start_index
end

#valueObject (readonly)

Returns the value of attribute value.



5
6
7
# File 'lib/todo_time_patterns/tokens.rb', line 5

def value
  @value
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/todo_time_patterns/tokens.rb', line 13

def to_s
  "{word}"
end