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.



54
55
56
# File 'lib/eac_ruby_utils/yaml.rb', line 54

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



50
51
52
# File 'lib/eac_ruby_utils/yaml.rb', line 50

def source
  @source
end

Instance Method Details

#resultObject



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

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

  source.to_s
end