Class: EacRubyUtils::Yaml::Sanitizer

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_ruby_utils/yaml.rb

Constant Summary collapse

RESULT_TYPES =
%w[permitted enumerableable hashable].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ Sanitizer

Returns a new instance of Sanitizer.



52
53
54
# File 'lib/eac_ruby_utils/yaml.rb', line 52

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



48
49
50
# File 'lib/eac_ruby_utils/yaml.rb', line 48

def source
  @source
end

Instance Method Details

#resultObject



56
57
58
59
60
61
62
# File 'lib/eac_ruby_utils/yaml.rb', line 56

def result
  RESULT_TYPES.each do |type|
    return send("result_#{type}") if send("result_#{type}?")
  end

  source.to_s
end