Class: TimePatterns::TimeToken
- Inherits:
-
Object
- Object
- TimePatterns::TimeToken
- 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.
-
#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) ⇒ TimeToken
constructor
A new instance of TimeToken.
- #to_s ⇒ Object
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_index ⇒ Object (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 |
#hours ⇒ Object (readonly)
Returns the value of attribute hours.
64 65 66 |
# File 'lib/todo_time_patterns/tokens.rb', line 64 def hours @hours end |
#minutes ⇒ Object (readonly)
Returns the value of attribute minutes.
65 66 67 |
# File 'lib/todo_time_patterns/tokens.rb', line 65 def minutes @minutes end |
#start_index ⇒ Object (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_s ⇒ Object
75 76 77 |
# File 'lib/todo_time_patterns/tokens.rb', line 75 def to_s "{time}" end |