Class: Bickle::LengthDecorator
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Bickle::LengthDecorator
- Defined in:
- lib/bickle/length_decorator.rb
Instance Method Summary collapse
- #branch ⇒ Object
- #commit ⇒ Object
-
#initialize(build, column_widths = {}) ⇒ LengthDecorator
constructor
A new instance of LengthDecorator.
- #message ⇒ Object
- #state ⇒ Object
Constructor Details
#initialize(build, column_widths = {}) ⇒ LengthDecorator
Returns a new instance of LengthDecorator.
3 4 5 6 7 8 |
# File 'lib/bickle/length_decorator.rb', line 3 def initialize(build, column_widths = {}) @build = build @column_widths = column_widths super(@build) end |
Instance Method Details
#branch ⇒ Object
18 19 20 |
# File 'lib/bickle/length_decorator.rb', line 18 def branch normalize_width(@build.branch, "branch", 10) end |
#commit ⇒ Object
14 15 16 |
# File 'lib/bickle/length_decorator.rb', line 14 def commit normalize_width(@build.commit, "commit", 5) end |
#message ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/bickle/length_decorator.rb', line 22 def = @build. = .gsub(/\s+/, " ") = .strip normalize_width(, "message", 50) end |
#state ⇒ Object
10 11 12 |
# File 'lib/bickle/length_decorator.rb', line 10 def state normalize_width(@build.state, "state", 10) end |