Method: ActiveFactory::FactoryDSL#method_missing
- Defined in:
- lib/active_factory.rb
#method_missing(method, *args, &expression) ⇒ Object
65 66 67 68 69 70 |
# File 'lib/active_factory.rb', line 65 def method_missing method, *args, &expression if args.many? or args.any? and block_given? raise "should be either block or value: #{method} #{args.inspect[1..-2]}" end @attribute_expressions[method.to_sym] = expression || proc { args[0] } end |