Class: PVN::Status::EntryFormatter
- Inherits:
-
Formatter
- Object
- ColorFormatter
- Formatter
- PVN::Status::EntryFormatter
- Defined in:
- lib/pvn/status/formatter/entry_formatter.rb
Constant Summary
Constants inherited from Formatter
Instance Attribute Summary collapse
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
Attributes inherited from Formatter
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(use_colors, entry) ⇒ EntryFormatter
constructor
A new instance of EntryFormatter.
Methods inherited from Formatter
Methods inherited from ColorFormatter
Constructor Details
#initialize(use_colors, entry) ⇒ EntryFormatter
Returns a new instance of EntryFormatter.
12 13 14 15 |
# File 'lib/pvn/status/formatter/entry_formatter.rb', line 12 def initialize use_colors, entry super use_colors @entry = entry end |
Instance Attribute Details
#entry ⇒ Object (readonly)
Returns the value of attribute entry.
10 11 12 |
# File 'lib/pvn/status/formatter/entry_formatter.rb', line 10 def entry @entry end |
Instance Method Details
#format ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/pvn/status/formatter/entry_formatter.rb', line 17 def format lines = Array.new lines << if use_colors " " + colorize(entry.path, entry.status.to_sym) else "#{entry.status[0 .. 0].upcase} #{entry.path}" end lines end |