Class: Evertils::Common::Converter::YamlToEnml
- Defined in:
- lib/evertils/common/converter/yaml_to_enml.rb
Overview
Instance Method Summary collapse
Methods inherited from Generic
#bytesize, #deprecation_notice, #encoding, #force_encoding, #has_required_fields, #initialize
Constructor Details
This class inherits a constructor from Evertils::Common::Generic
Instance Method Details
#from_file(path) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/evertils/common/converter/yaml_to_enml.rb', line 8 def from_file(path) contents = File.open(path, "rb") { |io| io.read } obj = YAML::load(contents) builder(obj) end |
#from_string(yaml) ⇒ Object
17 18 19 20 21 |
# File 'lib/evertils/common/converter/yaml_to_enml.rb', line 17 def from_string(yaml) obj = YAML::load(yaml) builder(obj) end |