Module: ROM::DataProxy::ClassMethods
- Included in:
- ArrayDataset, EnumerableDataset
- Defined in:
- lib/rom/support/data_proxy.rb
Instance Method Summary collapse
-
#forward(*methods) ⇒ undefined
Forward provided methods to the underlaying data object.
-
#row_proc ⇒ Proc
private
Default no-op tuple proc.
Instance Method Details
#forward(*methods) ⇒ undefined
Forward provided methods to the underlaying data object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/rom/support/data_proxy.rb', line 79 def forward(*methods) # FIXME: we should probably raise if one of the non-forwardable methods # was provided (methods - NON_FORWARDABLE).each do |method_name| class_eval " def \#{method_name}(*args, &block)\n response = data.public_send(\#{method_name.inspect}, *args, &block)\n\n if response.equal?(data)\n self\n elsif response.is_a?(data.class)\n self.class.new(response)\n else\n response\n end\n end\n RUBY\n end\nend\n", __FILE__, __LINE__ + 1 |
#row_proc ⇒ Proc
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.
Default no-op tuple proc
62 63 64 |
# File 'lib/rom/support/data_proxy.rb', line 62 def row_proc -> tuple { tuple } end |