Class: CDB::CLI
- Inherits:
-
Object
- Object
- CDB::CLI
- Defined in:
- lib/cdb/cli.rb
Constant Summary collapse
- COMMANDS =
%w[search show rename]
- TYPES =
%w[series issue issues]
Instance Method Summary collapse
- #[](k) ⇒ Object
- #[]=(k, v) ⇒ Object
- #execute ⇒ Object
-
#initialize(options = {}) ⇒ CLI
constructor
A new instance of CLI.
Constructor Details
#initialize(options = {}) ⇒ CLI
Returns a new instance of CLI.
8 9 10 |
# File 'lib/cdb/cli.rb', line 8 def initialize(={}) @options = end |
Instance Method Details
#[](k) ⇒ Object
12 13 14 |
# File 'lib/cdb/cli.rb', line 12 def [](k) @options[k] end |
#[]=(k, v) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/cdb/cli.rb', line 16 def []=(k, v) v = v.to_s.strip begin send("#{k}=", v) rescue NoMethodError @options[k] = v end end |
#execute ⇒ Object
25 26 27 |
# File 'lib/cdb/cli.rb', line 25 def execute send self[:command] end |