Class: Facter::ResolvedFact
- Inherits:
-
Object
- Object
- Facter::ResolvedFact
- Defined in:
- lib/facter/models/resolved_fact.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#filter_tokens ⇒ Object
Returns the value of attribute filter_tokens.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#user_query ⇒ Object
Returns the value of attribute user_query.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #core? ⇒ Boolean
-
#initialize(name, value = '', type = :core, user_query = nil, filter_tokens = []) ⇒ ResolvedFact
constructor
A new instance of ResolvedFact.
- #legacy? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(name, value = '', type = :core, user_query = nil, filter_tokens = []) ⇒ ResolvedFact
Returns a new instance of ResolvedFact.
8 9 10 11 12 13 14 |
# File 'lib/facter/models/resolved_fact.rb', line 8 def initialize(name, value = '', type = :core, user_query = nil, filter_tokens = []) @name = name @value = Utils.deep_stringify_keys(value) @type = type @user_query = user_query @filter_tokens = filter_tokens end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
6 7 8 |
# File 'lib/facter/models/resolved_fact.rb', line 6 def file @file end |
#filter_tokens ⇒ Object
Returns the value of attribute filter_tokens.
6 7 8 |
# File 'lib/facter/models/resolved_fact.rb', line 6 def filter_tokens @filter_tokens end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/facter/models/resolved_fact.rb', line 5 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/facter/models/resolved_fact.rb', line 5 def type @type end |
#user_query ⇒ Object
Returns the value of attribute user_query.
6 7 8 |
# File 'lib/facter/models/resolved_fact.rb', line 6 def user_query @user_query end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/facter/models/resolved_fact.rb', line 6 def value @value end |
Instance Method Details
#core? ⇒ Boolean
20 21 22 |
# File 'lib/facter/models/resolved_fact.rb', line 20 def core? type == :core end |
#legacy? ⇒ Boolean
16 17 18 |
# File 'lib/facter/models/resolved_fact.rb', line 16 def legacy? type == :legacy end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/facter/models/resolved_fact.rb', line 24 def to_s @value.to_s end |