Class: Lutra::Scanner
- Inherits:
-
Object
- Object
- Lutra::Scanner
- Defined in:
- lib/lutra/scanner.rb
Instance Attribute Summary collapse
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
Instance Method Summary collapse
-
#initialize(formatter = Formatters::Default.new) ⇒ Scanner
constructor
A new instance of Scanner.
- #scan_file(path, tags, comments) ⇒ Object
Constructor Details
#initialize(formatter = Formatters::Default.new) ⇒ Scanner
Returns a new instance of Scanner.
7 8 9 |
# File 'lib/lutra/scanner.rb', line 7 def initialize(formatter = Formatters::Default.new) @formatter = formatter end |
Instance Attribute Details
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
5 6 7 |
# File 'lib/lutra/scanner.rb', line 5 def formatter @formatter end |
Instance Method Details
#scan_file(path, tags, comments) ⇒ Object
11 12 13 14 15 |
# File 'lib/lutra/scanner.rb', line 11 def scan_file(path, , comments) notes = extract(File.open(path), path, , comments) formatter.display(notes) end |