Class: TimePatterns::IntervalEndingToken
- Inherits:
-
Object
- Object
- TimePatterns::IntervalEndingToken
- Defined in:
- lib/todo_time_patterns/tokens.rb
Instance Attribute Summary collapse
-
#end_index ⇒ Object
readonly
Returns the value of attribute end_index.
-
#hours ⇒ Object
readonly
Returns the value of attribute hours.
-
#interval ⇒ Object
readonly
Returns the value of attribute interval.
-
#minutes ⇒ Object
readonly
Returns the value of attribute minutes.
-
#start_index ⇒ Object
readonly
Returns the value of attribute start_index.
Instance Method Summary collapse
-
#initialize(values) ⇒ IntervalEndingToken
constructor
A new instance of IntervalEndingToken.
- #set_start_and_end_indexes(values) ⇒ Object
- #set_time_and_interval(values) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(values) ⇒ IntervalEndingToken
Returns a new instance of IntervalEndingToken.
202 203 204 205 206 207 208 |
# File 'lib/todo_time_patterns/tokens.rb', line 202 def initialize(values) @values = values @values.extend(TokensStringRepresentation) set_start_and_end_indexes values set_time_and_interval values end |
Instance Attribute Details
#end_index ⇒ Object (readonly)
Returns the value of attribute end_index.
197 198 199 |
# File 'lib/todo_time_patterns/tokens.rb', line 197 def end_index @end_index end |
#hours ⇒ Object (readonly)
Returns the value of attribute hours.
199 200 201 |
# File 'lib/todo_time_patterns/tokens.rb', line 199 def hours @hours end |
#interval ⇒ Object (readonly)
Returns the value of attribute interval.
200 201 202 |
# File 'lib/todo_time_patterns/tokens.rb', line 200 def interval @interval end |
#minutes ⇒ Object (readonly)
Returns the value of attribute minutes.
198 199 200 |
# File 'lib/todo_time_patterns/tokens.rb', line 198 def minutes @minutes end |
#start_index ⇒ Object (readonly)
Returns the value of attribute start_index.
196 197 198 |
# File 'lib/todo_time_patterns/tokens.rb', line 196 def start_index @start_index end |
Instance Method Details
#set_start_and_end_indexes(values) ⇒ Object
210 211 212 213 |
# File 'lib/todo_time_patterns/tokens.rb', line 210 def set_start_and_end_indexes(values) @start_index = values.first.start_index @end_index = values.last.end_index end |
#set_time_and_interval(values) ⇒ Object
215 216 217 218 219 220 221 |
# File 'lib/todo_time_patterns/tokens.rb', line 215 def set_time_and_interval(values) time = values[1] @minutes = time.minutes @hours = time.hours @interval = values[3].minutes end |
#to_s ⇒ Object
223 224 225 |
# File 'lib/todo_time_patterns/tokens.rb', line 223 def to_s "{ending_form}" end |