Class: Aspera::Cli::OptionSpec
- Inherits:
-
Struct
- Object
- Struct
- Aspera::Cli::OptionSpec
- Defined in:
- lib/aspera/cli/command_spec.rb
Overview
Declares an option referenced by name from command declarations.
Mirrors the existing options.declare call but associates the option with
the command(s) that use it.
Instance Attribute Summary collapse
-
#allowed ⇒ Object
readonly
Allowed values (forwarded to options.declare).
-
#deprecation ⇒ Object
readonly
Forwarded to options.declare as deprecation:.
-
#description ⇒ Object
readonly
User-facing description; nil derives it from schema:.
-
#schema ⇒ Object
readonly
JSON schema name; also derives description when nil.
-
#short ⇒ Object
readonly
Single-character short form (e.g. 'x').
Instance Method Summary collapse
-
#default(value) ⇒ Object
Default value.
-
#handler(value) ⇒ Object
- Symbol: resolved to
, m: at runtime (Category B) - Hash:
- Symbol: resolved to
-
#name(value) ⇒ Object
Option name (same symbol used in options.declare).
Instance Attribute Details
#allowed ⇒ Object (readonly)
Allowed values (forwarded to options.declare)
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/aspera/cli/command_spec.rb', line 58 OptionSpec = Struct.new( :name, :description, :allowed, :default, :short, :handler, # kept as-is: this is the option accessor delegation, not a command action :deprecation, :schema, keyword_init: true ) |
#deprecation ⇒ Object (readonly)
Forwarded to options.declare as deprecation:
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/aspera/cli/command_spec.rb', line 58 OptionSpec = Struct.new( :name, :description, :allowed, :default, :short, :handler, # kept as-is: this is the option accessor delegation, not a command action :deprecation, :schema, keyword_init: true ) |
#description ⇒ Object (readonly)
User-facing description; nil derives it from schema:
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/aspera/cli/command_spec.rb', line 58 OptionSpec = Struct.new( :name, :description, :allowed, :default, :short, :handler, # kept as-is: this is the option accessor delegation, not a command action :deprecation, :schema, keyword_init: true ) |
#schema ⇒ Object (readonly)
JSON schema name; also derives description when nil
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/aspera/cli/command_spec.rb', line 58 OptionSpec = Struct.new( :name, :description, :allowed, :default, :short, :handler, # kept as-is: this is the option accessor delegation, not a command action :deprecation, :schema, keyword_init: true ) |
#short ⇒ Object (readonly)
Single-character short form (e.g. 'x')
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/aspera/cli/command_spec.rb', line 58 OptionSpec = Struct.new( :name, :description, :allowed, :default, :short, :handler, # kept as-is: this is the option accessor delegation, not a command action :deprecation, :schema, keyword_init: true ) |
Instance Method Details
#default=(value) ⇒ Object
Default value
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/aspera/cli/command_spec.rb', line 58 OptionSpec = Struct.new( :name, :description, :allowed, :default, :short, :handler, # kept as-is: this is the option accessor delegation, not a command action :deprecation, :schema, keyword_init: true ) |
#handler=(value) ⇒ Object
- Symbol: resolved to
, m: at runtime (Category B) - Hash:
- nil: option stores its value locally (no delegation)
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/aspera/cli/command_spec.rb', line 58 OptionSpec = Struct.new( :name, :description, :allowed, :default, :short, :handler, # kept as-is: this is the option accessor delegation, not a command action :deprecation, :schema, keyword_init: true ) |
#name=(value) ⇒ Object
Option name (same symbol used in options.declare)
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/aspera/cli/command_spec.rb', line 58 OptionSpec = Struct.new( :name, :description, :allowed, :default, :short, :handler, # kept as-is: this is the option accessor delegation, not a command action :deprecation, :schema, keyword_init: true ) |