Class: Lutra::Scanner
- Inherits:
-
Object
- Object
- Lutra::Scanner
- Defined in:
- lib/lutra/scanner.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#notes ⇒ Object
readonly
Returns the value of attribute notes.
-
#tags ⇒ Object
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Scanner
constructor
A new instance of Scanner.
- #scan(source) ⇒ Object
- #scan_file(path) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Scanner
Returns a new instance of Scanner.
6 7 8 9 10 |
# File 'lib/lutra/scanner.rb', line 6 def initialize( = {}) = [:tags] || TAGS.dup @comments = [:comments] || COMM.dup @notes = [] end |
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments.
3 4 5 |
# File 'lib/lutra/scanner.rb', line 3 def comments @comments end |
#notes ⇒ Object (readonly)
Returns the value of attribute notes.
4 5 6 |
# File 'lib/lutra/scanner.rb', line 4 def notes @notes end |
#tags ⇒ Object
Returns the value of attribute tags.
3 4 5 |
# File 'lib/lutra/scanner.rb', line 3 def end |
Instance Method Details
#scan(source) ⇒ Object
12 13 14 15 |
# File 'lib/lutra/scanner.rb', line 12 def scan(source) and check_comments extract(source.split("\n")) and self end |
#scan_file(path) ⇒ Object
17 18 19 20 |
# File 'lib/lutra/scanner.rb', line 17 def scan_file(path) and check_comments extract(File.open(path), path) and self end |