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
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
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.
150 151 152 153 |
# File 'lib/tap/support/join.rb', line 150 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>”
163 164 165 |
# File 'lib/tap/support/join.rb', line 163 def inspect "#<ReverseJoin:#{object_id}>" end |
#join(target, sources, &block) ⇒ Object
Creates a join between the sources and target. Must be implemented in subclasses.
158 159 160 |
# File 'lib/tap/support/join.rb', line 158 def join(target, sources, &block) raise NotImplementedError end |