Class: OpenURL::Inventor
- Inherits:
-
Object
- Object
- OpenURL::Inventor
- Defined in:
- lib/openurl/metadata_formats/scholarly_common.rb
Instance Attribute Summary collapse
-
#inv ⇒ Object
Returns the value of attribute inv.
-
#invfirst ⇒ Object
Returns the value of attribute invfirst.
-
#invlast ⇒ Object
Returns the value of attribute invlast.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize ⇒ Inventor
constructor
A new instance of Inventor.
- #xml(elem) ⇒ Object
Constructor Details
#initialize ⇒ Inventor
Returns a new instance of Inventor.
179 180 |
# File 'lib/openurl/metadata_formats/scholarly_common.rb', line 179 def initialize end |
Instance Attribute Details
#inv ⇒ Object
Returns the value of attribute inv.
178 179 180 |
# File 'lib/openurl/metadata_formats/scholarly_common.rb', line 178 def inv @inv end |
#invfirst ⇒ Object
Returns the value of attribute invfirst.
178 179 180 |
# File 'lib/openurl/metadata_formats/scholarly_common.rb', line 178 def invfirst @invfirst end |
#invlast ⇒ Object
Returns the value of attribute invlast.
178 179 180 |
# File 'lib/openurl/metadata_formats/scholarly_common.rb', line 178 def invlast @invlast end |
Instance Method Details
#empty? ⇒ Boolean
200 201 202 203 204 205 |
# File 'lib/openurl/metadata_formats/scholarly_common.rb', line 200 def empty? self.instance_variables.each do | ivar | return false if self.instance_variable_get(ivar) end return true end |
#xml(elem) ⇒ Object
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/openurl/metadata_formats/scholarly_common.rb', line 182 def xml(elem) if @inv inv = elem.add_element("#{elem.prefix}:inv") inv.text = @inv end if @invlast || @invfirst inventor = elem.add_element("#{elem.prefix}:inventor") if @invlast invlast = inventor.add_element("#{elem.prefix}:invlast") invlast.text = @invlast end if @invfirst invfirst = inventor.add_element("#{elem.prefix}:invfirst") invfirst.text = @invfirst end end end |