Class: Cardigan::Command::ChangeValue

Inherits:
Object
  • Object
show all
Defined in:
lib/cardigan/command/change_value.rb

Instance Method Summary collapse

Constructor Details

#initialize(entry, io) ⇒ ChangeValue

Returns a new instance of ChangeValue.



6
7
8
# File 'lib/cardigan/command/change_value.rb', line 6

def initialize entry, io
  @entry, @io = entry, io
end

Instance Method Details

#execute(key) ⇒ Object



10
11
12
# File 'lib/cardigan/command/change_value.rb', line 10

def execute key
  Cardigan::CardEditor.new(@entry, @io).set key, @io.ask("Enter the new value for #{key}")
end