Class: Cardigan::Command::ChangeValue
- Inherits:
-
Object
- Object
- Cardigan::Command::ChangeValue
- Defined in:
- lib/cardigan/command/change_value.rb
Instance Attribute Summary collapse
-
#help ⇒ Object
readonly
Returns the value of attribute help.
-
#usage ⇒ Object
readonly
Returns the value of attribute usage.
Instance Method Summary collapse
- #execute(key) ⇒ Object
-
#initialize(entry, io) ⇒ ChangeValue
constructor
A new instance of ChangeValue.
Constructor Details
#initialize(entry, io) ⇒ ChangeValue
Returns a new instance of ChangeValue.
7 8 9 10 11 |
# File 'lib/cardigan/command/change_value.rb', line 7 def initialize entry, io @entry, @io = entry, io @usage = '<key>' @help = 'Prompt for a new value to associate with the specified key' end |
Instance Attribute Details
#help ⇒ Object (readonly)
Returns the value of attribute help.
5 6 7 |
# File 'lib/cardigan/command/change_value.rb', line 5 def help @help end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
5 6 7 |
# File 'lib/cardigan/command/change_value.rb', line 5 def usage @usage end |
Instance Method Details
#execute(key) ⇒ Object
13 14 15 |
# File 'lib/cardigan/command/change_value.rb', line 13 def execute key Cardigan::CardEditor.new(@entry, @io).set key, @io.ask("Enter the new value for #{key}") end |