Class: Tap::Support::ReverseJoin
Overview
Like a Join, but with a single target and multiple sources.
Direct Known Subclasses
Constant Summary
Constants inherited from Join
Join::FLAGS, Join::SHORT_FLAGS
Instance Attribute Summary
Attributes included from Configurable
Class Method Summary collapse
-
.join(target, sources, &block) ⇒ Object
Create a join between the sources and target.
Instance Method Summary collapse
-
#inspect ⇒ Object
Returns a string like: “#<ReverseJoin:object_id>”.
-
#join(target, sources, &block) ⇒ Object
Creates a join between the sources and target.
Methods inherited from Join
Methods included from Configurable
included, #initialize_copy, #reconfigure
Constructor Details
This class inherits a constructor from Tap::Support::Join
Class Method Details
.join(target, sources, &block) ⇒ Object
Create a join between the sources and target. Sources should be an array; if the last member of sources is a hash, it will be used as the configurations for the join.
125 126 127 128 |
# File 'lib/tap/support/join.rb', line 125 def join(target, sources, &block) = sources[-1].kind_of?(Hash) ? sources.pop : {} new().join(target, sources, &block) end |
Instance Method Details
#inspect ⇒ Object
Returns a string like: “#<ReverseJoin:object_id>”
138 139 140 |
# File 'lib/tap/support/join.rb', line 138 def inspect "#<ReverseJoin:#{object_id}>" end |
#join(target, sources, &block) ⇒ Object
Creates a join between the sources and target. Must be implemented in subclasses.
133 134 135 |
# File 'lib/tap/support/join.rb', line 133 def join(target, sources, &block) raise NotImplementedError end |