Sha256: bcf3f8d417b7eac573f13064a0703456ba533b9c239fb9566c1e9079c850e049

Contents?: true

Size: 503 Bytes

Versions: 16

Compression:

Stored size: 503 Bytes

Contents

module Ldp
  class Container::Direct < Container::Basic
    def members
      return enum_for(:members) unless block_given?

      response_graph.query(subject: subject, predicate: member_relation).map do |x|
        yield rdf_source_for(x.object)
      end
    end

    def member_relation
      response_graph.first_object(predicate: RDF::Vocab::LDP.hasMemberRelation) || RDF::Vocab::LDP.member
    end

    protected

    def interaction_model
      RDF::Vocab::LDP.DirectContainer
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ldp-1.2.1 lib/ldp/container/direct.rb
ldp-1.2.0 lib/ldp/container/direct.rb
ldp-1.1.0 lib/ldp/container/direct.rb
ldp-1.0.3 lib/ldp/container/direct.rb
ldp-1.0.2 lib/ldp/container/direct.rb
ldp-1.0.1 lib/ldp/container/direct.rb
ldp-1.0.0 lib/ldp/container/direct.rb
ldp-0.7.2 lib/ldp/container/direct.rb
ldp-0.7.1 lib/ldp/container/direct.rb
ldp-0.7.0 lib/ldp/container/direct.rb
ldp-0.6.4 lib/ldp/container/direct.rb
ldp-0.6.3 lib/ldp/container/direct.rb
ldp-0.6.2 lib/ldp/container/direct.rb
ldp-0.6.1 lib/ldp/container/direct.rb
ldp-0.6.0 lib/ldp/container/direct.rb
ldp-0.5.0 lib/ldp/container/direct.rb