Class: Resto::Translator::RequestFactory
- Defined in:
- lib/resto/translator/request_factory.rb
Instance Method Summary collapse
Methods inherited from Factory
Constructor Details
This class inherits a constructor from Resto::Translator::Factory
Instance Method Details
#call(attributes) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/resto/translator/request_factory.rb', line 33 def call(attributes) attributes ||= {} raise ArgumentError unless attributes.is_a?(Hash) @keys.reverse.inject(attributes) do |memo, item| Hash.new.tap {|h| h[item] = memo } end end |