Module: Vx::Builder::Source::Serializable::ClassMethods
- Defined in:
- lib/vx/builder/source/serializable.rb
Instance Method Summary collapse
Instance Method Details
#from_attributes(attrs) ⇒ Object
34 35 36 |
# File 'lib/vx/builder/source/serializable.rb', line 34 def from_attributes(attrs) Source.new attrs end |
#from_file(file) ⇒ Object
24 25 26 27 28 |
# File 'lib/vx/builder/source/serializable.rb', line 24 def from_file(file) if File.readable? file from_yaml File.read(file) end end |
#from_yaml(yaml) ⇒ Object
30 31 32 |
# File 'lib/vx/builder/source/serializable.rb', line 30 def from_yaml(yaml) from_attributes YAML.load(yaml) end |