Class: Jats::Annotation

Inherits:
Node
  • Object
show all
Defined in:
lib/jats/annotation.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#index, #xml

Instance Method Summary collapse

Methods inherited from Node

from_xml, index_for, #initialize, #name, reset_indices, #to_hash, #type

Constructor Details

This class inherits a constructor from Jats::Node

Instance Attribute Details

#sourceObject

Returns the value of attribute source.



3
4
5
# File 'lib/jats/annotation.rb', line 3

def source
  @source
end

Instance Method Details

#attributesObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/jats/annotation.rb', line 5

def attributes
  rid = xml['rid']
  id  = rid.gsub('ref-', '')

  {
    source:  source,
    content: xml.text,
    target:  "article:bib#{id}"
  }
end