Class: Argstring::Arguments
- Inherits:
-
Object
- Object
- Argstring::Arguments
- Defined in:
- lib/argstring/models/arguments.rb
Instance Attribute Summary collapse
-
#all ⇒ Object
readonly
Returns the value of attribute all.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#flag ⇒ Object
readonly
Returns the value of attribute flag.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#named ⇒ Object
readonly
Returns the value of attribute named.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#positional ⇒ Object
readonly
Returns the value of attribute positional.
-
#valid ⇒ Object
readonly
Returns the value of attribute valid.
Instance Method Summary collapse
-
#error_messages ⇒ Object
Human-readable errors.
-
#initialize(valid:, errors:, all:, positional:, named:, flags:, position:, name:, flag:) ⇒ Arguments
constructor
A new instance of Arguments.
- #valid? ⇒ Boolean
Constructor Details
#initialize(valid:, errors:, all:, positional:, named:, flags:, position:, name:, flag:) ⇒ Arguments
Returns a new instance of Arguments.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/argstring/models/arguments.rb', line 8 def initialize(valid:, errors:, all:, positional:, named:, flags:, position:, name:, flag:) @valid = valid @errors = errors @all = all @positional = positional @named = named @flags = flags @position = position @name = name @flag = flag end |
Instance Attribute Details
#all ⇒ Object (readonly)
Returns the value of attribute all.
5 6 7 |
# File 'lib/argstring/models/arguments.rb', line 5 def all @all end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/argstring/models/arguments.rb', line 5 def errors @errors end |
#flag ⇒ Object (readonly)
Returns the value of attribute flag.
6 7 8 |
# File 'lib/argstring/models/arguments.rb', line 6 def flag @flag end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
5 6 7 |
# File 'lib/argstring/models/arguments.rb', line 5 def flags @flags end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/argstring/models/arguments.rb', line 6 def name @name end |
#named ⇒ Object (readonly)
Returns the value of attribute named.
5 6 7 |
# File 'lib/argstring/models/arguments.rb', line 5 def named @named end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
6 7 8 |
# File 'lib/argstring/models/arguments.rb', line 6 def position @position end |
#positional ⇒ Object (readonly)
Returns the value of attribute positional.
5 6 7 |
# File 'lib/argstring/models/arguments.rb', line 5 def positional @positional end |
#valid ⇒ Object (readonly)
Returns the value of attribute valid.
5 6 7 |
# File 'lib/argstring/models/arguments.rb', line 5 def valid @valid end |
Instance Method Details
#error_messages ⇒ Object
Human-readable errors
25 26 27 |
# File 'lib/argstring/models/arguments.rb', line 25 def @errors.map(&:to_s) end |
#valid? ⇒ Boolean
20 21 22 |
# File 'lib/argstring/models/arguments.rb', line 20 def valid? @valid end |