Class: Cardigan::Command::CreateCard
- Inherits:
-
Object
- Object
- Cardigan::Command::CreateCard
- Defined in:
- lib/cardigan/command/create_card.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(name) ⇒ Object
-
#initialize(repository) ⇒ CreateCard
constructor
A new instance of CreateCard.
Constructor Details
#initialize(repository) ⇒ CreateCard
Returns a new instance of CreateCard.
7 8 9 10 11 |
# File 'lib/cardigan/command/create_card.rb', line 7 def initialize repository @repository = repository @usage = '<name>' @help = 'Creates a new card with the specified name (without opening it for editing)' end |
Instance Attribute Details
#help ⇒ Object (readonly)
Returns the value of attribute help.
5 6 7 |
# File 'lib/cardigan/command/create_card.rb', line 5 def help @help end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
5 6 7 |
# File 'lib/cardigan/command/create_card.rb', line 5 def usage @usage end |
Instance Method Details
#execute(name) ⇒ Object
13 14 15 |
# File 'lib/cardigan/command/create_card.rb', line 13 def execute name @repository[UUIDTools::UUID.random_create.to_s] = {'name' => name } end |