Module: YAMLHelper
- Defined in:
- lib/streetcreds/patches/yaml_patch.rb
Class Method Summary collapse
Class Method Details
.load_if_valid(str) ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/streetcreds/patches/yaml_patch.rb', line 2 def self.load_if_valid(str) res = YAML.load(str) return false unless res.is_a?(Hash) res # rescue Exception => e # return false end |