Class: Ltsview::Parse
- Inherits:
-
Object
- Object
- Ltsview::Parse
- Defined in:
- lib/ltsview/parse.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Parse
constructor
A new instance of Parse.
- #print ⇒ Object
Constructor Details
#initialize(options) ⇒ Parse
Returns a new instance of Parse.
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/ltsview/parse.rb', line 4 def initialize() @options = { :mode => :yaml, :color => true, :file => nil, :keys => nil, :ignore_key => nil, :regex => nil } option_parse end |
Instance Method Details
#print ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/ltsview/parse.rb', line 16 def print file_or_stdin do |ltsv| next if ltsv.nil? line = formatter(filter(ltsv)) puts "#{tag}#{line}" unless line.nil? $stdout.flush end end |