Class: Xlgrep::SimpleFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/xlgrep/simple_formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(io = nil) ⇒ SimpleFormatter

Returns a new instance of SimpleFormatter.



5
6
7
# File 'lib/xlgrep/simple_formatter.rb', line 5

def initialize(io = nil)
  @io = io || $stdout
end

Instance Method Details

#process(obj) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/xlgrep/simple_formatter.rb', line 9

def process(obj)
  @io.puts "-" * 80
  @io.puts "file    : " << obj[:file]
  @io.puts "sheet   : " << obj[:sheet]
  @io.puts "position: " << obj[:x] << obj[:y].to_s
  @io.puts "cell    : " << obj[:data]
  @io.puts "msg     : " << obj[:msg]
end