Sha256: 6b5e0d237429e30274ef0ba4a6f1f7d265fdecdf817198b9da29d5724e702d60

Contents?: true

Size: 690 Bytes

Versions: 1

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true

module Pragma
  module Decorator
    module Association
      class ExpansionError < StandardError
      end

      class AssociationNotFound < ExpansionError
        attr_reader :property

        def initialize(property)
          @property = property
          super "The '#{property}' association is not defined."
        end
      end

      class UnexpandedAssociationParent < ExpansionError
        attr_reader :child, :parent

        def initialize(child, parent)
          @child = child
          @parent = parent

          super "The '#{child}' association is expanded, but its parent '#{parent}' is not."
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pragma-decorator-2.0.0 lib/pragma/decorator/association/errors.rb