Class: Debtective::Comments::Print
- Inherits:
-
Object
- Object
- Debtective::Comments::Print
- Defined in:
- lib/debtective/comments/print.rb
Overview
Print elements as a table in the stdout and return the block result
Defined Under Namespace
Classes: Column
Constant Summary collapse
- COLUMNS =
[ Column.new( "location", "%-100.100s", -> { _1.location } ), Column.new( "type", "%-7.7s", -> { _1.type } ), Column.new( "author", "%-20.20s", -> { _1.commit..name || "?" } ) ].freeze
Instance Method Summary collapse
-
#call ⇒ Object
Yielded bloc result.
-
#initialize(user_name: nil) ⇒ Print
constructor
A new instance of Print.
Constructor Details
#initialize(user_name: nil) ⇒ Print
Returns a new instance of Print.
30 31 32 |
# File 'lib/debtective/comments/print.rb', line 30 def initialize(user_name: nil) @user_name = user_name end |
Instance Method Details
#call ⇒ Object
Returns yielded bloc result.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/debtective/comments/print.rb', line 35 def call puts separator puts headers_row puts separator trace.enable result = yield trace.disable puts separator result end |