Sha256: e33a16442b1f6fe8e7f2044fb58487b8f159316fd9d79d0332168211ef04a8be

Contents?: true

Size: 655 Bytes

Versions: 12

Compression:

Stored size: 655 Bytes

Contents

# frozen_string_literal: true
module ActiveTriples
  ##
  # An error class to be raised when attempting to reflect on an undefined 
  # property.
  #
  # @example
  #   begin 
  #     my_source.set_value(:fake_property, 'blah')
  #   rescue ActiveTriples::UndefinedPropertyError => e
  #     e.property => 'fake_property'
  #     e.klass => 'MySourceClass'
  #   end
  #   
  class UndefinedPropertyError < ArgumentError
    attr_reader :property, :klass

    def initialize(property, klass)
      @property = property
      @klass = klass
    end

    def message
      "The property `#{@property}` is not defined on class '#{@klass}'"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
active-triples-1.2.0 lib/active_triples/undefined_property_error.rb
active-triples-1.1.1 lib/active_triples/undefined_property_error.rb
active-triples-1.1.0 lib/active_triples/undefined_property_error.rb
active-triples-1.0.0 lib/active_triples/undefined_property_error.rb
active-triples-1.0.0.rc1 lib/active_triples/undefined_property_error.rb
active-triples-0.11.0 lib/active_triples/undefined_property_error.rb
active-triples-0.10.2 lib/active_triples/undefined_property_error.rb
active-triples-0.10.1 lib/active_triples/undefined_property_error.rb
active-triples-0.10.0 lib/active_triples/undefined_property_error.rb
active-triples-0.9.0 lib/active_triples/undefined_property_error.rb
active-triples-0.8.3 lib/active_triples/undefined_property_error.rb
active-triples-0.8.2 lib/active_triples/undefined_property_error.rb