Method: ROM::Command::ClassInterface#relation_methods_mod

Defined in:
lib/rom/commands/class_interface.rb

#relation_methods_mod(relation_class) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/rom/commands/class_interface.rb', line 251

def relation_methods_mod(relation_class)
  Module.new do
    relation_class.view_methods.each do |meth|
      module_eval "        def \#{meth}(*args)\n          response = relation.public_send(:\#{meth}, *args)\n\n          if response.is_a?(relation.class)\n            new(response)\n          else\n            response\n          end\n        end\n      RUBY\n    end\n  end\nend\n", __FILE__, __LINE__ + 1