Class: Tap::Support::ReverseJoin

Inherits:
Join show all
Defined in:
lib/tap/support/join.rb

Overview

Like a Join, but with a single target and multiple sources.

Direct Known Subclasses

Joins::Merge, Joins::SyncMerge

Constant Summary

Constants inherited from Join

Join::FLAGS, Join::SHORT_FLAGS

Instance Attribute Summary

Attributes included from Configurable

#config

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Join

#initialize, #name, #options

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)
  options = sources[-1].kind_of?(Hash) ? sources.pop : {}
  new(options).join(target, sources, &block)
end

Instance Method Details

#inspectObject

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.

Raises:

  • (NotImplementedError)


133
134
135
# File 'lib/tap/support/join.rb', line 133

def join(target, sources, &block)
  raise NotImplementedError
end