Sha256: cd22fdc4ab67d93e9f663b1452a4db6ac127312a57b32feae84af6b69164f81b
Contents?: true
Size: 912 Bytes
Versions: 3
Compression:
Stored size: 912 Bytes
Contents
module Troo class ListDecorator include DecoratorHelpers def initialize(list, options = {}) @list = list @options = options end def short [default_str, id_str, name_str].join + "\n" end def name_str highlight(name, options) end def default_str default.center(3) end def id_str highlight(brackets(id) + " ", options).rjust(6) end def name (list.name && list.name.chomp) || "N/A" end def default list.default? ? "*" : "" end def id list.id.to_s end def cards(alt_options = {}) list.cards.map { |card| card.decorator(alt_options) } end private attr_reader :list def options defaults.merge!(@options) end def defaults { ansicolor: true, colour: Esc.green, underline: Esc.underline } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
troo-0.0.7 | lib/troo/display/list_decorator.rb |
troo-0.0.6 | lib/troo/display/list_decorator.rb |
troo-0.0.5 | lib/troo/display/list_decorator.rb |