Class: Ykutils::Lines

Inherits:
Object
  • Object
show all
Defined in:
lib/ykutils/lines.rb

Direct Known Subclasses

AccountLines, XLines

Instance Method Summary collapse

Constructor Details

#initialize(line_ary) ⇒ Lines

Returns a new instance of Lines.



13
14
15
16
17
18
19
# File 'lib/ykutils/lines.rb', line 13

def initialize(line_ary)
  @lines = BasicLines.new(line_ary)
  @line_stack = []
  @status = nil

  setup
end

Instance Method Details

#lineObject



23
24
25
# File 'lib/ykutils/lines.rb', line 23

def line
  @line_stack.shift if @line_stack.size > -1
end

#output_f(fname) ⇒ Object



27
28
29
30
31
32
33
34
35
# File 'lib/ykutils/lines.rb', line 27

def output_f(fname)
  return unless fname

  File.open(fname, "w") do |file|
    @line_stack.each do |it|
      file.write(it.to_s)
    end
  end
end

#setupObject



21
# File 'lib/ykutils/lines.rb', line 21

def setup; end