Class: Brew::Npm::CLI::Arguments
- Inherits:
-
Object
- Object
- Brew::Npm::CLI::Arguments
- Defined in:
- lib/brew/npm/cli.rb
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(args) ⇒ Arguments
constructor
A new instance of Arguments.
- #npm ⇒ Object
- #supplied_version ⇒ Object
- #to_args ⇒ Object
Constructor Details
#initialize(args) ⇒ Arguments
Returns a new instance of Arguments.
22 23 24 25 |
# File 'lib/brew/npm/cli.rb', line 22 def initialize(args) @args = args @args_without_flags = @args.reject {|a| a.start_with?("-") } end |
Instance Method Details
#command ⇒ Object
27 28 29 |
# File 'lib/brew/npm/cli.rb', line 27 def command @args_without_flags[0] end |
#npm ⇒ Object
31 32 33 |
# File 'lib/brew/npm/cli.rb', line 31 def npm @args_without_flags[1] end |
#supplied_version ⇒ Object
35 36 37 |
# File 'lib/brew/npm/cli.rb', line 35 def supplied_version @args_without_flags[2] end |
#to_args ⇒ Object
39 40 41 |
# File 'lib/brew/npm/cli.rb', line 39 def to_args @args.reject {|a| a == npm || a == supplied_version } end |