Class: Jats::Figure
Instance Attribute Summary
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 Method Details
#attributes ⇒ Object
22
23
24
|
# File 'lib/jats/figure.rb', line 22
def attributes
{ doi: doi, label: label, url: url, caption: caption }
end
|
#caption ⇒ Object
15
16
17
18
19
20
|
# File 'lib/jats/figure.rb', line 15
def caption
{
title: xml.css('caption title').text,
content: xml.css('caption p').text
}
end
|
#doi ⇒ Object
3
4
5
|
# File 'lib/jats/figure.rb', line 3
def doi
xml.css('object-id[pub-id-type="doi"]').text
end
|
#label ⇒ Object
7
8
9
|
# File 'lib/jats/figure.rb', line 7
def label
xml.css('label').text
end
|
#url ⇒ Object
11
12
13
|
# File 'lib/jats/figure.rb', line 11
def url
xml.css('graphic')[0]['xlink:href']
end
|