Class: Tomo::CLI::State
- Inherits:
-
Object
- Object
- Tomo::CLI::State
- Defined in:
- lib/tomo/cli/state.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#processed_rules ⇒ Object
readonly
Returns the value of attribute processed_rules.
Instance Method Summary collapse
-
#initialize ⇒ State
constructor
A new instance of State.
- #parsed_arg(arg) ⇒ Object
- #parsed_option(key, value) ⇒ Object
- #processed?(rule) ⇒ Boolean
- #processed_rule(rule) ⇒ Object
Constructor Details
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
6 7 8 |
# File 'lib/tomo/cli/state.rb', line 6 def args @args end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/tomo/cli/state.rb', line 6 def @options end |
#processed_rules ⇒ Object (readonly)
Returns the value of attribute processed_rules.
6 7 8 |
# File 'lib/tomo/cli/state.rb', line 6 def processed_rules @processed_rules end |
Instance Method Details
#parsed_arg(arg) ⇒ Object
14 15 16 |
# File 'lib/tomo/cli/state.rb', line 14 def parsed_arg(arg) args << arg end |
#parsed_option(key, value) ⇒ Object
18 19 20 |
# File 'lib/tomo/cli/state.rb', line 18 def parsed_option(key, value) .all(key) << value end |
#processed?(rule) ⇒ Boolean
26 27 28 |
# File 'lib/tomo/cli/state.rb', line 26 def processed?(rule) @processed_rules.include?(rule) end |
#processed_rule(rule) ⇒ Object
22 23 24 |
# File 'lib/tomo/cli/state.rb', line 22 def processed_rule(rule) @processed_rules |= [rule] end |