Class: Ronin::Recon::InputFile
- Inherits:
-
Object
- Object
- Ronin::Recon::InputFile
- Defined in:
- lib/ronin/recon/input_file.rb
Overview
Represents an input file of values to recon.
Instance Attribute Summary collapse
-
#path ⇒ String
readonly
The path to the input file.
Class Method Summary collapse
-
.open(path) ⇒ Object
Opens the input file.
Instance Method Summary collapse
-
#each {|value| ... } ⇒ Enumerator
Enumerates over every value in the input file.
-
#initialize(path) ⇒ InputFile
constructor
Initializes the input file.
Constructor Details
#initialize(path) ⇒ InputFile
Initializes the input file.
41 42 43 |
# File 'lib/ronin/recon/input_file.rb', line 41 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ String (readonly)
The path to the input file.
33 34 35 |
# File 'lib/ronin/recon/input_file.rb', line 33 def path @path end |
Class Method Details
.open(path) ⇒ Object
Opens the input file.
53 54 55 |
# File 'lib/ronin/recon/input_file.rb', line 53 def self.open(path) new(path) end |
Instance Method Details
#each {|value| ... } ⇒ Enumerator
Enumerates over every value in the input file.
69 70 71 72 73 74 75 76 77 |
# File 'lib/ronin/recon/input_file.rb', line 69 def each return enum_for unless block_given? File.open(@path) do |file| file.each_line(chomp: true) do |line| yield Value.parse(line) end end end |