Module: ROM::DataProxy::ClassMethods
- Included in:
- ArrayDataset, EnumerableDataset
- Defined in:
- lib/rom/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
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/rom/data_proxy.rb', line 73 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
56 57 58 |
# File 'lib/rom/data_proxy.rb', line 56 def row_proc -> tuple { tuple } end |