Sha256: 9bd4bb09450dd90827c8ec51793eb6dba585c654caacee5398c544f71a9d6dd4

Contents?: true

Size: 632 Bytes

Versions: 1

Compression:

Stored size: 632 Bytes

Contents

# frozen_string_literal: true

require 'gladwords/relation/joined_relation'

module Gladwords
  class Relation < ROM::Relation
    # Instance methods for associations
    #
    # @api public
    module AssociationMethods
      def self.included(klass)
        klass.option :dependant_associations, default: -> { [] }
      end

      # Join with other datasets
      #
      # @param [Array<Dataset>] args A list of dataset to join with
      #
      # @return [Dataset]
      #
      # @api public
      def join(*args)
        targets = nodes(*args)

        JoinedRelation.new(self, targets).relation
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gladwords-1.0.1 lib/gladwords/relation/association_methods.rb