Class: Moose::Inventory::RuntimeOptions
- Inherits:
-
Object
- Object
- Moose::Inventory::RuntimeOptions
- Defined in:
- lib/moose_inventory/runtime_options.rb
Overview
Small value object for resolved runtime CLI options.
Instance Attribute Summary collapse
-
#argv ⇒ Object
readonly
Returns the value of attribute argv.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
Instance Method Summary collapse
- #ansible? ⇒ Boolean
-
#initialize(argv:, config:, env:, format:, flags:) ⇒ RuntimeOptions
constructor
A new instance of RuntimeOptions.
- #output_format ⇒ Object
- #trace? ⇒ Boolean
Constructor Details
#initialize(argv:, config:, env:, format:, flags:) ⇒ RuntimeOptions
Returns a new instance of RuntimeOptions.
9 10 11 12 13 14 15 16 |
# File 'lib/moose_inventory/runtime_options.rb', line 9 def initialize(argv:, config:, env:, format:, flags:) @argv = argv @config = config @env = env @format = format @ansible = flags[:ansible] == true @trace = flags[:trace] == true end |
Instance Attribute Details
#argv ⇒ Object (readonly)
Returns the value of attribute argv.
7 8 9 |
# File 'lib/moose_inventory/runtime_options.rb', line 7 def argv @argv end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/moose_inventory/runtime_options.rb', line 7 def config @config end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
7 8 9 |
# File 'lib/moose_inventory/runtime_options.rb', line 7 def env @env end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
7 8 9 |
# File 'lib/moose_inventory/runtime_options.rb', line 7 def format @format end |
Instance Method Details
#ansible? ⇒ Boolean
18 19 20 |
# File 'lib/moose_inventory/runtime_options.rb', line 18 def ansible? @ansible end |
#output_format ⇒ Object
26 27 28 |
# File 'lib/moose_inventory/runtime_options.rb', line 26 def output_format format.to_s.downcase end |
#trace? ⇒ Boolean
22 23 24 |
# File 'lib/moose_inventory/runtime_options.rb', line 22 def trace? @trace end |