Class: Facter::Options

Inherits:
Object
  • Object
show all
Includes:
ConfigFileOptions, DefaultOptions, HelperOptions, PriorityOptions, ValidateOptions, Singleton
Defined in:
lib/framework/core/options.rb

Constant Summary

Constants included from DefaultOptions

DefaultOptions::DEFAULT_LOG_LEVEL

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ValidateOptions

#validate_configs

Methods included from HelperOptions

#augment_with_helper_options!

Methods included from PriorityOptions

#augment_with_priority_options!

Methods included from ConfigFileOptions

#augment_with_config_file_options!

Methods included from DefaultOptions

#augment_with_defaults!, #augment_with_to_hash_defaults!

Constructor Details

#initializeOptions

Returns a new instance of Options.



15
16
17
18
# File 'lib/framework/core/options.rb', line 15

def initialize
  @options = {}
  @priority_options = {}
end

Instance Attribute Details

#priority_optionsObject



13
14
15
# File 'lib/framework/core/options.rb', line 13

def priority_options
  @priority_options
end

Class Method Details

.method_missing(name, *args, &block) ⇒ Object



51
52
53
54
55
# File 'lib/framework/core/options.rb', line 51

def self.method_missing(name, *args, &block)
  Facter::Options.instance.send(name.to_s, *args, &block)
rescue NoMethodError
  super
end

.respond_to_missing?(name, include_private) ⇒ Boolean

Returns:

  • (Boolean)


57
# File 'lib/framework/core/options.rb', line 57

def self.respond_to_missing?(name, include_private) end

Instance Method Details

#[](option) ⇒ Object



31
32
33
# File 'lib/framework/core/options.rb', line 31

def [](option)
  @options.fetch(option, nil)
end

#custom_dirObject



39
40
41
# File 'lib/framework/core/options.rb', line 39

def custom_dir
  @options[:custom_dir]
end

#custom_dir?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/framework/core/options.rb', line 35

def custom_dir?
  @options[:custom_dir] && @options[:custom_facts]
end

#external_dirObject



47
48
49
# File 'lib/framework/core/options.rb', line 47

def external_dir
  @options[:external_dir]
end

#external_dir?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/framework/core/options.rb', line 43

def external_dir?
  @options[:external_dir] && @options[:external_facts]
end

#getObject



27
28
29
# File 'lib/framework/core/options.rb', line 27

def get
  @options
end

#refresh(user_query = []) ⇒ Object



20
21
22
23
24
25
# File 'lib/framework/core/options.rb', line 20

def refresh(user_query = [])
  @user_query = user_query
  initialize_options

  @options
end