Class: Nodectl::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/nodectl/options.rb

Overview

Boot options container, keep info about node directory structure etc

Instance Method Summary collapse

Constructor Details

#initialize(overrides = {}) ⇒ Options

Returns a new instance of Options.



3
4
5
6
# File 'lib/nodectl/options.rb', line 3

def initialize(overrides = {})
  @options = default_options.merge(overrides)
  @options = calculate_options(@options)
end

Instance Method Details

#[](option_name) ⇒ Object



8
9
10
# File 'lib/nodectl/options.rb', line 8

def [](option_name)
  @options[option_name.to_s]
end

#inspectObject



12
13
14
# File 'lib/nodectl/options.rb', line 12

def inspect
  @options.inspect
end

#to_hashObject



20
21
22
# File 'lib/nodectl/options.rb', line 20

def to_hash
  @options
end

#to_sObject



16
17
18
# File 'lib/nodectl/options.rb', line 16

def to_s
  @options.to_s
end