Class: Bolt::PAL::YamlPlan::EvaluableString

Inherits:
Object
  • Object
show all
Defined in:
lib/bolt/pal/yaml_plan.rb

Overview

This class wraps a value parsed from YAML which may be Puppet code. That includes double-quoted strings and string literals, each of which subclasses this parent class in order to implement its own evaluation logic.

Direct Known Subclasses

BareString, CodeLiteral, DoubleQuotedString

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, file = nil, line = nil) ⇒ EvaluableString

Returns a new instance of EvaluableString.



103
104
105
106
107
# File 'lib/bolt/pal/yaml_plan.rb', line 103

def initialize(value, file = nil, line = nil)
  @value = value
  @file  = file
  @line  = line
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



101
102
103
# File 'lib/bolt/pal/yaml_plan.rb', line 101

def file
  @file
end

#lineObject (readonly)

Returns the value of attribute line.



101
102
103
# File 'lib/bolt/pal/yaml_plan.rb', line 101

def line
  @line
end

#valueObject (readonly)

Returns the value of attribute value.



101
102
103
# File 'lib/bolt/pal/yaml_plan.rb', line 101

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



109
110
111
# File 'lib/bolt/pal/yaml_plan.rb', line 109

def ==(other)
  self.class == other.class && @value == other.value
end