Class: ColorLS::Layout
- Inherits:
-
Object
show all
- Defined in:
- lib/colorls/layout.rb
Instance Method Summary
collapse
Constructor Details
#initialize(contents, widths, line_size) ⇒ Layout
5
6
7
8
9
|
# File 'lib/colorls/layout.rb', line 5
def initialize(contents, widths, line_size)
@max_widths = widths
@contents = contents
@screen_width = line_size
end
|
Instance Method Details
#each_line ⇒ Object
11
12
13
14
15
|
# File 'lib/colorls/layout.rb', line 11
def each_line
return if @contents.empty?
get_chunks(chunk_size).each { |line| yield(line.compact, @max_widths) }
end
|