Class: Obp::Access::Renderer::Elements::Root
- Inherits:
-
Object
- Object
- Obp::Access::Renderer::Elements::Root
- Defined in:
- lib/obp/access/elements/root.rb
Constant Summary collapse
- TITLE_PARTS =
%w[intro main compl].freeze
Instance Attribute Summary collapse
-
#metas ⇒ Object
readonly
Returns the value of attribute metas.
-
#urn ⇒ Object
readonly
Returns the value of attribute urn.
Instance Method Summary collapse
-
#content ⇒ Object
rubocop:disable Metrics/AbcSize.
-
#initialize(urn:, metas:) ⇒ Root
constructor
A new instance of Root.
- #to_document ⇒ Object
Constructor Details
#initialize(urn:, metas:) ⇒ Root
Returns a new instance of Root.
12 13 14 15 |
# File 'lib/obp/access/elements/root.rb', line 12 def initialize(urn:, metas:) @urn = urn @metas = end |
Instance Attribute Details
#metas ⇒ Object (readonly)
Returns the value of attribute metas.
10 11 12 |
# File 'lib/obp/access/elements/root.rb', line 10 def @metas end |
#urn ⇒ Object (readonly)
Returns the value of attribute urn.
10 11 12 |
# File 'lib/obp/access/elements/root.rb', line 10 def urn @urn end |
Instance Method Details
#content ⇒ Object
rubocop:disable Metrics/AbcSize
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/obp/access/elements/root.rb', line 17 def content # rubocop:disable Metrics/AbcSize Nokogiri::XML::Builder.new(namespace_inheritance: false, encoding: "UTF-8") do |xml| xml.standard("xmlns:ali": "http://www.niso.org/schemas/ali/1.0/", "xmlns:mml": "http://www.w3.org/1998/Math/MathML", "xmlns:tbx": "urn:iso:std:iso:30042:ed-2", "xmlns:xlink": "http://www.w3.org/1999/xlink", "dtd-version": "1.0") do xml.front do xml.public_send(:"std-meta", "std-meta-type": "international") do (xml) end end xml.body xml.back end end end |
#to_document ⇒ Object
36 37 38 |
# File 'lib/obp/access/elements/root.rb', line 36 def to_document content.doc end |