Class: Puppet::Pops::PN::Literal
Constant Summary
KEY_PATTERN
Instance Attribute Summary collapse
Instance Method Summary
collapse
#==, #as_call, #as_parameters, #double_quote, #format_elements, #pnError, #to_s, #with_name
Constructor Details
#initialize(value) ⇒ Literal
Returns a new instance of Literal.
177
178
179
|
# File 'lib/puppet/pops/pn.rb', line 177
def initialize(value)
@value = value
end
|
Instance Attribute Details
175
176
177
|
# File 'lib/puppet/pops/pn.rb', line 175
def value
@value
end
|
Instance Method Details
#eql?(o) ⇒ Boolean
191
192
193
|
# File 'lib/puppet/pops/pn.rb', line 191
def eql?(o)
o.is_a?(Literal) && @value == o.value
end
|
181
182
183
184
185
186
187
188
189
|
# File 'lib/puppet/pops/pn.rb', line 181
def format(indent, b)
if @value.nil?
b << 'nil'
elsif value.is_a?(String)
double_quote(value, b)
else
b << value.to_s
end
end
|
195
196
197
|
# File 'lib/puppet/pops/pn.rb', line 195
def to_data
@value
end
|