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(tags: Lutra::TAGS, comments: Lutra::COMMENTS) ⇒ Scanner
constructor
A new instance of Scanner.
- #scan_file(path) ⇒ Object
Constructor Details
#initialize(tags: Lutra::TAGS, comments: Lutra::COMMENTS) ⇒ Scanner
Returns a new instance of Scanner.
8 9 10 11 12 13 14 |
# File 'lib/lutra/scanner.rb', line 8 def initialize(tags: Lutra::TAGS, comments: Lutra::COMMENTS) raise EmptyTagListError if .empty? raise EmptyCommentListError if comments.empty? , @comments = , comments @notes = [] end |
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments.
5 6 7 |
# File 'lib/lutra/scanner.rb', line 5 def comments @comments end |
#notes ⇒ Object (readonly)
Returns the value of attribute notes.
6 7 8 |
# File 'lib/lutra/scanner.rb', line 6 def notes @notes end |
#tags ⇒ Object
Returns the value of attribute tags.
5 6 7 |
# File 'lib/lutra/scanner.rb', line 5 def end |
Instance Method Details
#scan_file(path) ⇒ Object
16 17 18 |
# File 'lib/lutra/scanner.rb', line 16 def scan_file(path) extract(File.open(path), path) end |