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.


43
44
45
# File 'lib/eac_ruby_utils/yaml.rb', line 43

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source


39
40
41
# File 'lib/eac_ruby_utils/yaml.rb', line 39

def source
  @source
end

Instance Method Details

#resultObject


47
48
49
50
51
52
53
# File 'lib/eac_ruby_utils/yaml.rb', line 47

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

  source.to_s
end