Sha256: b9afbe8c93ad354a9e8d6c9cdc39ef26a220db313d88aee56e0ae39de859f77f

Contents?: true

Size: 458 Bytes

Versions: 9

Compression:

Stored size: 458 Bytes

Contents

require "addressable"

module RelatonBib
  # Typed URI
  class TypedUri
    # @return [Symbol] :src/:obp/:rss
    attr_reader :type
    # @retutn [URI]
    attr_reader :content

    # @param type [String] src/obp/rss
    # @param content [String]
    def initialize(type:, content:)
      @type    = type
      @content = Addressable::URI.parse content if content
    end

    def to_xml(builder)
      builder.uri(content.to_s, type: type)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
relaton-bib-0.2.5 lib/relaton_bib/typed_uri.rb
relaton-bib-0.2.4 lib/relaton_bib/typed_uri.rb
relaton-bib-0.2.3 lib/relaton_bib/typed_uri.rb
relaton-bib-0.2.2 lib/relaton_bib/typed_uri.rb
relaton-bib-0.2.1 lib/relaton_bib/typed_uri.rb
relaton-bib-0.2.0 lib/relaton_bib/typed_uri.rb
relaton-bib-0.1.6 lib/relaton_bib/typed_uri.rb
relaton-bib-0.1.5 lib/relaton_bib/typed_uri.rb
relaton-bib-0.1.3 lib/relaton_bib/typed_uri.rb