Class: Linkterm::Documents
- Inherits:
-
Object
- Object
- Linkterm::Documents
- Includes:
- Enumerable
- Defined in:
- lib/linkterm.rb
Instance Attribute Summary collapse
-
#filenames ⇒ Object
readonly
Returns the value of attribute filenames.
Instance Method Summary collapse
- #each(range = [email protected]) ⇒ Object
-
#initialize(filenames) ⇒ Documents
constructor
A new instance of Documents.
Methods included from Enumerable
Constructor Details
#initialize(filenames) ⇒ Documents
Returns a new instance of Documents.
151 152 153 |
# File 'lib/linkterm.rb', line 151 def initialize(filenames) @filenames = filenames end |
Instance Attribute Details
#filenames ⇒ Object (readonly)
Returns the value of attribute filenames.
148 149 150 |
# File 'lib/linkterm.rb', line 148 def filenames @filenames end |
Instance Method Details
#each(range = [email protected]) ⇒ Object
155 156 157 158 159 160 |
# File 'lib/linkterm.rb', line 155 def each(range = 0...@filenames.size) filenames[range].each {|filename| document = Document.new(File.open(filename, 'r') {|io| io.read }) yield document } end |