Class: RunKit::Options::Positional
- Inherits:
-
Object
- Object
- RunKit::Options::Positional
- Defined in:
- lib/run_kit/options/positional.rb
Constant Summary collapse
- POSITIONAL_RE =
/\A<([A-Z]\w*)>\z/i
Instance Attribute Summary collapse
-
#help ⇒ Object
readonly
Returns the value of attribute help.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
Instance Method Summary collapse
-
#initialize(meta:, help:) ⇒ Positional
constructor
A new instance of Positional.
-
#key ⇒ Object
one-liners.
Constructor Details
#initialize(meta:, help:) ⇒ Positional
Returns a new instance of Positional.
12 13 14 15 16 17 |
# File 'lib/run_kit/options/positional.rb', line 12 def initialize(meta:, help:) @help, @meta = help, raise ArgumentError, "positional help must be a string" unless help.is_a?(String) raise ArgumentError, "positional meta must be a string" unless .is_a?(String) raise ArgumentError, "positional must use <meta>" unless POSITIONAL_RE.match?() end |
Instance Attribute Details
#help ⇒ Object (readonly)
Returns the value of attribute help.
10 11 12 |
# File 'lib/run_kit/options/positional.rb', line 10 def help @help end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
10 11 12 |
# File 'lib/run_kit/options/positional.rb', line 10 def @meta end |
Instance Method Details
#key ⇒ Object
one-liners
20 |
# File 'lib/run_kit/options/positional.rb', line 20 def key = @key ||= POSITIONAL_RE.match()[1].to_sym |