Class: Facter::OptionStore

Inherits:
Object
  • Object
show all
Defined in:
lib/framework/core/options/option_store.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.blockObject

Returns the value of attribute block.



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

def block
  @block
end

.blocked_factsObject

Returns the value of attribute blocked_facts.



22
23
24
# File 'lib/framework/core/options/option_store.rb', line 22

def blocked_facts
  @blocked_facts
end

.cacheObject

Returns the value of attribute cache.



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

def cache
  @cache
end

.cliObject

Returns the value of attribute cli.



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

def cli
  @cli
end

.configObject

Returns the value of attribute config.



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

def config
  @config
end

.custom_dirObject

Returns the value of attribute custom_dir.



22
23
24
# File 'lib/framework/core/options/option_store.rb', line 22

def custom_dir
  @custom_dir
end

.custom_factsObject

Returns the value of attribute custom_facts.



22
23
24
# File 'lib/framework/core/options/option_store.rb', line 22

def custom_facts
  @custom_facts
end

.debugObject

Returns the value of attribute debug.



22
23
24
# File 'lib/framework/core/options/option_store.rb', line 22

def debug
  @debug
end

.external_dirObject

Returns the value of attribute external_dir.



22
23
24
# File 'lib/framework/core/options/option_store.rb', line 22

def external_dir
  @external_dir
end

.external_factsObject

Returns the value of attribute external_facts.



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

def external_facts
  @external_facts
end

.hamlObject

Returns the value of attribute haml.



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

def haml
  @haml
end

.jsonObject

Returns the value of attribute json.



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

def json
  @json
end

.log_levelObject

Returns the value of attribute log_level.



22
23
24
# File 'lib/framework/core/options/option_store.rb', line 22

def log_level
  @log_level
end

.puppetObject

Returns the value of attribute puppet.



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

def puppet
  @puppet
end

.rubyObject

Returns the value of attribute ruby.



22
23
24
# File 'lib/framework/core/options/option_store.rb', line 22

def ruby
  @ruby
end

.show_legacyObject

Returns the value of attribute show_legacy.



22
23
24
# File 'lib/framework/core/options/option_store.rb', line 22

def show_legacy
  @show_legacy
end

.strictObject

Returns the value of attribute strict.



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

def strict
  @strict
end

.traceObject

Returns the value of attribute trace.



22
23
24
# File 'lib/framework/core/options/option_store.rb', line 22

def trace
  @trace
end

.ttlsObject

Returns the value of attribute ttls.



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

def ttls
  @ttls
end

.user_queryObject

Returns the value of attribute user_query.



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

def user_query
  @user_query
end

.verboseObject

Returns the value of attribute verbose.



22
23
24
# File 'lib/framework/core/options/option_store.rb', line 22

def verbose
  @verbose
end

.yamlObject

Returns the value of attribute yaml.



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

def yaml
  @yaml
end

Class Method Details

.allObject



29
30
31
32
33
34
35
36
# File 'lib/framework/core/options/option_store.rb', line 29

def all
  options = {}
  instance_variables.each do |iv|
    variable_name = iv.to_s.delete('@')
    options[variable_name.to_sym] = OptionStore.send(variable_name.to_sym)
  end
  options
end

.resetObject



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/framework/core/options/option_store.rb', line 137

def reset
  @debug = false
  @trace = false
  @verbose = false
  # TODO: constant is not yet available when running puppet facts
  @log_level = :warn
  @show_legacy = true
  @block = true
  @custom_dir = []
  @custom_facts = true
  @external_dir = []
  @external_facts = true
  @ruby = true
  @blocked_facts = []
  @user_query = []
  @cli = nil
end

.set(key, value) ⇒ Object



133
134
135
# File 'lib/framework/core/options/option_store.rb', line 133

def set(key, value)
  send("#{key}=".to_sym, value)
end