Class: MarketplaceKit::Services::ArgsParser
- Inherits:
-
Object
- Object
- MarketplaceKit::Services::ArgsParser
- Defined in:
- lib/marketplace_kit/services/args_parser.rb
Constant Summary collapse
- DEFAULT_ENV =
'localhost'
Instance Method Summary collapse
- #command_args ⇒ Object
- #command_name ⇒ Object
- #current_env ⇒ Object
-
#initialize(args) ⇒ ArgsParser
constructor
A new instance of ArgsParser.
Constructor Details
#initialize(args) ⇒ ArgsParser
Returns a new instance of ArgsParser.
6 7 8 |
# File 'lib/marketplace_kit/services/args_parser.rb', line 6 def initialize(args) @args = args end |
Instance Method Details
#command_args ⇒ Object
14 15 16 |
# File 'lib/marketplace_kit/services/args_parser.rb', line 14 def command_args @args[1..-1] || [] end |
#command_name ⇒ Object
10 11 12 |
# File 'lib/marketplace_kit/services/args_parser.rb', line 10 def command_name @args[0] end |
#current_env ⇒ Object
18 19 20 21 |
# File 'lib/marketplace_kit/services/args_parser.rb', line 18 def current_env return DEFAULT_ENV unless e_arg_index env_arg_value || DEFAULT_ENV end |