Class: Flakie::CLI::Options

Inherits:
Struct
  • Object
show all
Defined in:
lib/flakie/cli/options.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countObject

Returns the value of attribute count

Returns:

  • (Object)

    the current value of count



5
6
7
# File 'lib/flakie/cli/options.rb', line 5

def count
  @count
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



5
6
7
# File 'lib/flakie/cli/options.rb', line 5

def format
  @format
end

#helpObject

Returns the value of attribute help

Returns:

  • (Object)

    the current value of help



5
6
7
# File 'lib/flakie/cli/options.rb', line 5

def help
  @help
end

#outputObject

Returns the value of attribute output

Returns:

  • (Object)

    the current value of output



5
6
7
# File 'lib/flakie/cli/options.rb', line 5

def output
  @output
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



5
6
7
# File 'lib/flakie/cli/options.rb', line 5

def version
  @version
end

Class Method Details

.defaultObject



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 { |options| Parser.parse!(args, into: options) }

Instance Method Details

#help?Boolean

Returns:

  • (Boolean)


12
# File 'lib/flakie/cli/options.rb', line 12

def help? = help

#reporterObject



10
# File 'lib/flakie/cli/options.rb', line 10

def reporter = Reporters::ALL.fetch(format)

#version?Boolean

Returns:

  • (Boolean)


13
# File 'lib/flakie/cli/options.rb', line 13

def version? = version