Module: Setsumei::Build
- Defined in:
- lib/setsumei/build.rb,
lib/setsumei/build/key.rb
Defined Under Namespace
Classes: Key
Class Method Summary collapse
Class Method Details
.a(klass, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/setsumei/build.rb', line 5 def Build.a(klass, = {}) inform_developer "#{klass} should be able to list its attributes" unless klass.respond_to? :defined_attributes inform_developer "wrong number of arguments, options must include { from: data }" unless .keys.include? :from klass.new.tap do |object| klass.defined_attributes.each do |_,attribute| attribute.set_value_on object, from_value_in: [:from] end end end |