Class: Relish::Command::Base
- Inherits:
-
Object
- Object
- Relish::Command::Base
- Extended by:
- Dsl
- Defined in:
- lib/relish/commands/base.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
writeonly
Sets the attribute args.
-
#cli_options ⇒ Object
readonly
Returns the value of attribute cli_options.
Instance Method Summary collapse
- #get_param ⇒ Object
-
#initialize(args = []) ⇒ Base
constructor
A new instance of Base.
- #url ⇒ Object
Methods included from Dsl
Constructor Details
#initialize(args = []) ⇒ Base
Returns a new instance of Base.
18 19 20 21 22 23 24 |
# File 'lib/relish/commands/base.rb', line 18 def initialize(args = []) @args = clean_args(args) @param = get_param @cli_options = Hash[*@args] end |
Instance Attribute Details
#args=(value) ⇒ Object (writeonly)
Sets the attribute args
15 16 17 |
# File 'lib/relish/commands/base.rb', line 15 def args=(value) @args = value end |
#cli_options ⇒ Object (readonly)
Returns the value of attribute cli_options.
16 17 18 |
# File 'lib/relish/commands/base.rb', line 16 def @cli_options end |
Instance Method Details
#get_param ⇒ Object
30 31 32 |
# File 'lib/relish/commands/base.rb', line 30 def get_param @args.shift if @args.size.odd? end |
#url ⇒ Object
26 27 28 |
# File 'lib/relish/commands/base.rb', line 26 def url "http://#{host}/api" end |