Class: Uberpass::CLI::DumpDecorator

Inherits:
ListDecorator show all
Defined in:
lib/uberpass/cli.rb

Instance Method Summary collapse

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

#outputObject



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