Class: TimePatterns::TimeToken

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values) ⇒ TimeToken

Returns a new instance of TimeToken.



67
68
69
70
71
72
73
# File 'lib/todo_time_patterns/tokens.rb', line 67

def initialize(values)
  @values = values
  @values.extend(TokensStringRepresentation)

  set_start_and_end_indexes values
  set_hours_and_minutes values
end

Instance Attribute Details

#end_indexObject (readonly)

Returns the value of attribute end_index.



62
63
64
# File 'lib/todo_time_patterns/tokens.rb', line 62

def end_index
  @end_index
end

#hoursObject (readonly)

Returns the value of attribute hours.



64
65
66
# File 'lib/todo_time_patterns/tokens.rb', line 64

def hours
  @hours
end

#minutesObject (readonly)

Returns the value of attribute minutes.



65
66
67
# File 'lib/todo_time_patterns/tokens.rb', line 65

def minutes
  @minutes
end

#start_indexObject (readonly)

Returns the value of attribute start_index.



61
62
63
# File 'lib/todo_time_patterns/tokens.rb', line 61

def start_index
  @start_index
end

Instance Method Details

#to_sObject



75
76
77
# File 'lib/todo_time_patterns/tokens.rb', line 75

def to_s
  "{time}"
end