Class: Fluent::Config::YamlParser::FluentValue::StringValue

Inherits:
Struct
  • Object
show all
Defined in:
lib/fluent/config/yaml_parser/fluent_value.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject

Returns the value of attribute context

Returns:

  • (Object)

    the current value of context



31
32
33
# File 'lib/fluent/config/yaml_parser/fluent_value.rb', line 31

def context
  @context
end

#valObject

Returns the value of attribute val

Returns:

  • (Object)

    the current value of val



31
32
33
# File 'lib/fluent/config/yaml_parser/fluent_value.rb', line 31

def val
  @val
end

Instance Method Details

#to_elementObject



40
41
42
# File 'lib/fluent/config/yaml_parser/fluent_value.rb', line 40

def to_element
  to_s
end

#to_sObject



32
33
34
35
36
37
38
# File 'lib/fluent/config/yaml_parser/fluent_value.rb', line 32

def to_s
  context.instance_eval("\"#{val}\"")
rescue Fluent::SetNil => _
  ''
rescue Fluent::SetDefault => _
  ':default'
end