Class: Flakie::CLI::Options
- Inherits:
-
Struct
- Object
- Struct
- Flakie::CLI::Options
- Defined in:
- lib/flakie/cli/options.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#format ⇒ Object
Returns the value of attribute format.
-
#help ⇒ Object
Returns the value of attribute help.
-
#output ⇒ Object
Returns the value of attribute output.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count
5 6 7 |
# File 'lib/flakie/cli/options.rb', line 5 def count @count end |
#format ⇒ Object
Returns the value of attribute format
5 6 7 |
# File 'lib/flakie/cli/options.rb', line 5 def format @format end |
#help ⇒ Object
Returns the value of attribute help
5 6 7 |
# File 'lib/flakie/cli/options.rb', line 5 def help @help end |
#output ⇒ Object
Returns the value of attribute output
5 6 7 |
# File 'lib/flakie/cli/options.rb', line 5 def output @output end |
#version ⇒ Object
Returns the value of attribute version
5 6 7 |
# File 'lib/flakie/cli/options.rb', line 5 def version @version end |
Class Method Details
.default ⇒ Object
7 |
# File 'lib/flakie/cli/options.rb', line 7 def self.default = new(count: 5, format: :tictactoe, output: $stdout, help: false, version: false) |
.from(args) ⇒ Object
8 |
# File 'lib/flakie/cli/options.rb', line 8 def self.from(args) = default.tap { || Parser.parse!(args, into: ) } |
Instance Method Details
#help? ⇒ Boolean
12 |
# File 'lib/flakie/cli/options.rb', line 12 def help? = help |
#reporter ⇒ Object
10 |
# File 'lib/flakie/cli/options.rb', line 10 def reporter = Reporters::ALL.fetch(format) |
#version? ⇒ Boolean
13 |
# File 'lib/flakie/cli/options.rb', line 13 def version? = version |