class CFA::AugeasTreeValue

Represents a node that contains both a value and a subtree below it. For easier traversal it forwards `#[]` to the subtree.

Attributes

tree[RW]

@return [AugeasTree] the subtree below the node

value[R]

@return [String] the value in the node

Public Class Methods

new(tree, value) click to toggle source
# File lib/cfa/augeas_parser.rb, line 168
def initialize(tree, value)
  @tree = tree
  @value = value
  @modified = false
end

Public Instance Methods

==(other) click to toggle source
# File lib/cfa/augeas_parser.rb, line 184
def ==(other)
  [:class, :value, :tree].all? do |a|
    public_send(a) == other.public_send(a)
  end
end
Also aliased as: eql?
[](key) click to toggle source

(see AugeasTree#[])

# File lib/cfa/augeas_parser.rb, line 175
def [](key)
  tree[key]
end
eql?(other)

For objects of class Object, eql? is synonymous with ==: ruby-doc.org/core-2.3.3/Object.html#method-i-eql-3F

Alias for: ==
modified?() click to toggle source

@return true if the value has been modified

# File lib/cfa/augeas_parser.rb, line 191
def modified?
  @modified
end
value=(value) click to toggle source
# File lib/cfa/augeas_parser.rb, line 179
def value=(value)
  @value = value
  @modified = true
end