Class: Bickle::ThorBuildsTable

Inherits:
Object
  • Object
show all
Defined in:
lib/bickle/thor_builds_table.rb

Instance Method Summary collapse

Constructor Details

#initialize(headers, builds, shell) ⇒ ThorBuildsTable

Returns a new instance of ThorBuildsTable.



3
4
5
6
7
# File 'lib/bickle/thor_builds_table.rb', line 3

def initialize(headers, builds, shell)
  @headers = headers
  @builds  = builds
  @shell   = shell
end

Instance Method Details

#renderObject



9
10
11
12
13
14
15
16
17
# File 'lib/bickle/thor_builds_table.rb', line 9

def render
  rows = @builds.map do |build|
    @headers.map do |header|
      build.send header
    end
  end

  @shell.print_table(rows)
end