Sha256: 601d516d0b559ffc4b4d0389f203a609e5393f6e891b63d6fce95995497abcf7

Contents?: true

Size: 1.07 KB

Versions: 7

Compression:

Stored size: 1.07 KB

Contents

require 'typesafe_enum'
require 'xml/mapping_extensions'

module Stash
  module Sword
    class Namespace < TypesafeEnum::Base
      NS = XML::MappingExtensions::Namespace
      private_constant(:NS)

      new :SWORD, NS.new(uri: 'http://purl.org/net/sword/')
      new :SWORD_TERMS, NS.new(uri: 'http://purl.org/net/sword/terms/', prefix: 'sword')
      new :SWORD_PACKAGE, NS.new(uri: 'http://purl.org/net/sword/package')
      new :SWORD_ERROR, NS.new(uri: 'http://purl.org/net/sword/error')
      new :SWORD_STATE, NS.new(uri: 'http://purl.org/net/sword/state')
      new :ATOM_PUB, NS.new(uri: 'http://www.w3.org/2007/app', prefix: 'app')
      new :ATOM, NS.new(uri: 'http://www.w3.org/2005/Atom', prefix: 'atom')
      new :DC_TERMS, NS.new(uri: 'http://purl.org/dc/terms/', prefix: 'dcterms')
      new :RDF, NS.new(uri: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', prefix: 'rdf')
      new :OAI_ORE, NS.new(uri: 'http://www.openarchives.org/ore/terms/', prefix: 'ore')

      def uri
        value.uri
      end

      def prefix
        value.prefix
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
stash-sword-0.1.6 lib/stash/sword/namespace.rb
stash-sword-0.1.5 lib/stash/sword/namespace.rb
stash-sword-0.1.4 lib/stash/sword/namespace.rb
stash-sword-0.1.3 lib/stash/sword/namespace.rb
stash-sword-0.1.2 lib/stash/sword/namespace.rb
stash-sword-0.1.1 lib/stash/sword/namespace.rb
stash-sword-0.1.0 lib/stash/sword/namespace.rb