Class: IsoBibItem::TypedUri

Inherits:
Object
  • Object
show all
Defined in:
lib/iso_bib_item/bibliographic_item.rb

Overview

Typed URI

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, content:) ⇒ TypedUri

Returns a new instance of TypedUri.

Parameters:

  • type (String)

    src/obp/rss

  • content (String)


87
88
89
90
# File 'lib/iso_bib_item/bibliographic_item.rb', line 87

def initialize(type:, content:)
  @type    = type
  @content = URI content if content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



83
84
85
# File 'lib/iso_bib_item/bibliographic_item.rb', line 83

def content
  @content
end

#typeSymbol (readonly)

Returns :src/:obp/:rss.

Returns:

  • (Symbol)

    :src/:obp/:rss



81
82
83
# File 'lib/iso_bib_item/bibliographic_item.rb', line 81

def type
  @type
end

Instance Method Details

#to_xml(builder) ⇒ Object



92
93
94
# File 'lib/iso_bib_item/bibliographic_item.rb', line 92

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