Class: PLOS::Name
Instance Attribute Summary collapse
-
#given_name ⇒ Object
Returns the value of attribute given_name.
-
#style ⇒ Object
Returns the value of attribute style.
-
#surname ⇒ Object
Returns the value of attribute surname.
Instance Method Summary collapse
-
#initialize(node) ⇒ Name
constructor
A new instance of Name.
- #to_s ⇒ Object
Methods included from XmlHelpers
#nodes_to_hash, #parse_node, #tag_value
Constructor Details
#initialize(node) ⇒ Name
Returns a new instance of Name.
9 10 11 12 13 |
# File 'lib/plos/name.rb', line 9 def initialize(node) self.style = node.attr("name-style") if node.attr("name-style") self.given_name = tag_value(node, "given-names") self.surname = tag_value(node, "surname") end |
Instance Attribute Details
#given_name ⇒ Object
Returns the value of attribute given_name.
6 7 8 |
# File 'lib/plos/name.rb', line 6 def given_name @given_name end |
#style ⇒ Object
Returns the value of attribute style.
5 6 7 |
# File 'lib/plos/name.rb', line 5 def style @style end |
#surname ⇒ Object
Returns the value of attribute surname.
7 8 9 |
# File 'lib/plos/name.rb', line 7 def surname @surname end |
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'lib/plos/name.rb', line 15 def to_s "#{given_name} #{surname}" end |