Class: HttpFind::Output
- Inherits:
-
Object
- Object
- HttpFind::Output
- Defined in:
- lib/http_find/output.rb
Instance Method Summary collapse
-
#initialize(matches) ⇒ Output
constructor
A new instance of Output.
- #lines ⇒ Object
Constructor Details
#initialize(matches) ⇒ Output
Returns a new instance of Output.
3 4 5 |
# File 'lib/http_find/output.rb', line 3 def initialize(matches) @matches = matches end |
Instance Method Details
#lines ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/http_find/output.rb', line 7 def lines justlen = @matches.map { |m| m[:line] }.sort.last.to_s.length @matches.map do |m| line = m[:line].to_s text = m[:text] "#{line.rjust(justlen)} | #{text}" end end |