Sha256: 5dda1c9b23f29e0167486118cf3144209367e86e530d3839f49dc88c4e6a78ab
Contents?: true
Size: 678 Bytes
Versions: 25
Compression:
Stored size: 678 Bytes
Contents
require 'yaml' require 'json' module Vx module Builder class Source module Serializable def self.included(base) base.extend ClassMethods end def to_yaml YAML.dump(attributes) end def to_hash attributes end module ClassMethods def from_file(file) if File.readable? file from_yaml File.read(file) end end def from_yaml(yaml) from_attributes YAML.load(yaml) end def from_attributes(attrs) Source.new attrs end end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems