Class: Uberpass::CLI::DumpDecorator
- Inherits:
-
ListDecorator
- Object
- ListDecorator
- Uberpass::CLI::DumpDecorator
- Defined in:
- lib/uberpass/cli.rb
Instance Method Summary collapse
-
#initialize(terminal, entries) ⇒ DumpDecorator
constructor
A new instance of DumpDecorator.
- #output ⇒ Object
- #output_entry(key, value) ⇒ Object
Constructor Details
#initialize(terminal, entries) ⇒ DumpDecorator
Returns a new instance of DumpDecorator.
222 223 224 |
# File 'lib/uberpass/cli.rb', line 222 def initialize terminal, entries @terminal, @entries = terminal, entries end |
Instance Method Details
#output ⇒ Object
226 227 228 229 230 231 |
# File 'lib/uberpass/cli.rb', line 226 def output @entries.each do |entry| key = entry.keys.first output_entry key, entry[key] end end |
#output_entry(key, value) ⇒ Object
233 234 235 236 237 |
# File 'lib/uberpass/cli.rb', line 233 def output_entry(key, value) out = "<%= color('#{key}', :name) %>" out << " #{value["password"]}" @terminal.say out end |