Class: Rubsh::Argument
- Inherits:
-
Object
- Object
- Rubsh::Argument
- Defined in:
- lib/rubsh/argument.rb
Instance Method Summary collapse
- #compile(long_sep: "=", long_prefix: "--") ⇒ nil, ...
-
#initialize(*args) ⇒ Argument
constructor
A new instance of Argument.
- #value=(value) ⇒ void
Constructor Details
Instance Method Details
#compile(long_sep: "=", long_prefix: "--") ⇒ nil, ...
21 22 23 24 |
# File 'lib/rubsh/argument.rb', line 21 def compile(long_sep: "=", long_prefix: "--") return compile_positional_argument(@name) if @is_positional compile_option_argument(@name, @value, long_sep: long_sep, long_prefix: long_prefix) end |
#value=(value) ⇒ void
This method returns an undefined value.
15 16 17 18 |
# File 'lib/rubsh/argument.rb', line 15 def value=(value) raise ::ArgumentError, "cannot assign a new value for positional argument" if @is_positional @value = value end |