Class: Ykutils::Lines
- Inherits:
-
Object
- Object
- Ykutils::Lines
- Defined in:
- lib/ykutils/lines.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(line_ary) ⇒ Lines
constructor
A new instance of Lines.
- #line ⇒ Object
- #output_f(fname) ⇒ Object
- #setup ⇒ Object
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
#line ⇒ Object
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 |
#setup ⇒ Object
21 |
# File 'lib/ykutils/lines.rb', line 21 def setup; end |