Class: TodoAgent::Comment
- Inherits:
-
Object
- Object
- TodoAgent::Comment
- Defined in:
- lib/todo_agent/comment.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Instance Method Summary collapse
-
#initialize(match, filename, line) ⇒ Comment
constructor
A new instance of Comment.
- #tag ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(match, filename, line) ⇒ Comment
Returns a new instance of Comment.
7 8 9 10 11 |
# File 'lib/todo_agent/comment.rb', line 7 def initialize(match, filename, line) @filename = filename @match = match @line = line end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
5 6 7 |
# File 'lib/todo_agent/comment.rb', line 5 def filename @filename end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
5 6 7 |
# File 'lib/todo_agent/comment.rb', line 5 def line @line end |
Instance Method Details
#tag ⇒ Object
13 14 15 |
# File 'lib/todo_agent/comment.rb', line 13 def tag @match[1] end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/todo_agent/comment.rb', line 17 def to_s "Matched: #{tag} in #{filename} at line #{line}" end |