Sha256: 16d6a9c8e5d84443829b8f0534e5a5da0628ba1539738e237feeea0fe1bdfa9c

Contents?: true

Size: 776 Bytes

Versions: 10

Compression:

Stored size: 776 Bytes

Contents

module ActiveFedora::Aggregation
  class Reflection < ActiveFedora::Reflection::AssociationReflection
    def association_class
      Association
    end

    def klass
      @klass ||= begin
        klass = class_name.constantize
        klass.respond_to?(:uri_to_id) ? klass : ActiveFedora::Base
      rescue NameError => e
        # If the NameError is a result of the class having a
        # NameError (e.g. NoMethodError) within it then raise the error.
        raise e if Object.const_defined? class_name
        # Otherwise the NameError was a result of not being able to find the class
        ActiveFedora::Base
      end
    end

    def predicate
      @options[:predicate] || ::RDF::Vocab::ORE.aggregates
    end

    def collection?
      true
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
activefedora-aggregation-0.9.0 lib/active_fedora/aggregation/reflection.rb
activefedora-aggregation-0.8.1 lib/active_fedora/aggregation/reflection.rb
activefedora-aggregation-0.8.0 lib/active_fedora/aggregation/reflection.rb
activefedora-aggregation-0.7.0 lib/active_fedora/aggregation/reflection.rb
activefedora-aggregation-0.6.0 lib/active_fedora/aggregation/reflection.rb
activefedora-aggregation-0.5.0 lib/active_fedora/aggregation/reflection.rb
activefedora-aggregation-0.4.2 lib/active_fedora/aggregation/reflection.rb
activefedora-aggregation-0.4.1 lib/active_fedora/aggregation/reflection.rb
activefedora-aggregation-0.4.0 lib/active_fedora/aggregation/reflection.rb
activefedora-aggregation-0.3.0 lib/active_fedora/aggregation/reflection.rb