Sha256: 60204344f025fe832318ab45b1a7fbc976fcfd4aa602cffb875f57a1cdaf988d
Contents?: true
Size: 870 Bytes
Versions: 1
Compression:
Stored size: 870 Bytes
Contents
# frozen_string_literal: true require "rom/support/inflector" module ROM module Associations # @api private class ThroughIdentifier # @api private attr_reader :source # @api private attr_reader :target # @api private attr_reader :assoc_name # @api private def self.[](source, target, assoc_name = nil, inflector: Inflector) new(source, target, assoc_name || default_assoc_name(target, inflector: inflector)) end # @api private def self.default_assoc_name(relation, inflector:) inflector.singularize(relation).to_sym end # @api private def initialize(source, target, assoc_name) @source = source @target = target @assoc_name = assoc_name end # @api private def to_sym source end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rom-6.0.0.alpha1 | lib/rom/associations/through_identifier.rb |