Class: Csvlint::WrappedIO

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/csvlint/wrapped_io.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



3
4
5
# File 'lib/csvlint/wrapped_io.rb', line 3

def line
  @line
end

Instance Method Details

#gets(*args) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/csvlint/wrapped_io.rb', line 9

def gets(*args)
  if args.size == 1 && args[0].is_a?(String)
    s = __getobj__.gets(args[0])
    if s
      @line << s
    end
    s
  else
    __getobj__.gets(*args)
  end
end

#reset_lineObject



5
6
7
# File 'lib/csvlint/wrapped_io.rb', line 5

def reset_line
  @line = ''
end