Class: TodoAgent::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/todo_agent/comment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#filenameObject (readonly)

Returns the value of attribute filename.



5
6
7
# File 'lib/todo_agent/comment.rb', line 5

def filename
  @filename
end

#lineObject (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

#tagObject



13
14
15
# File 'lib/todo_agent/comment.rb', line 13

def tag
  @match[1]
end

#to_sObject



17
18
19
# File 'lib/todo_agent/comment.rb', line 17

def to_s
  "Matched: #{tag} in #{filename} at line #{line}"
end