Class: MML::Name
Instance Attribute Summary collapse
-
#degree ⇒ Object
Returns the value of attribute degree.
-
#family ⇒ Object
Returns the value of attribute family.
-
#fullname ⇒ Object
Returns the value of attribute fullname.
-
#given ⇒ Object
Returns the value of attribute given.
-
#middle ⇒ Object
Returns the value of attribute middle.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
Attributes inherited from BaseName
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Name
constructor
A new instance of Name.
- #to_xml ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Name
Returns a new instance of Name.
36 37 38 39 40 |
# File 'lib/mml/common.rb', line 36 def initialize(args = {}) %W(family given middle fullname prefix degree repCode tableId).each do |item| self.send("#{item}=", args[item.to_sym]) end end |
Instance Attribute Details
#degree ⇒ Object
Returns the value of attribute degree.
34 35 36 |
# File 'lib/mml/common.rb', line 34 def degree @degree end |
#family ⇒ Object
Returns the value of attribute family.
34 35 36 |
# File 'lib/mml/common.rb', line 34 def family @family end |
#fullname ⇒ Object
Returns the value of attribute fullname.
34 35 36 |
# File 'lib/mml/common.rb', line 34 def fullname @fullname end |
#given ⇒ Object
Returns the value of attribute given.
34 35 36 |
# File 'lib/mml/common.rb', line 34 def given @given end |
#middle ⇒ Object
Returns the value of attribute middle.
34 35 36 |
# File 'lib/mml/common.rb', line 34 def middle @middle end |
#prefix ⇒ Object
Returns the value of attribute prefix.
34 35 36 |
# File 'lib/mml/common.rb', line 34 def prefix @prefix end |
Instance Method Details
#to_xml ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/mml/common.rb', line 44 def to_xml xb = Builder::XmlMarkup.new xb.mmlNm(:Name, {'mmlNm:repCode' => @repCode, 'mmlNm:tableId' => @tableId}) do xb.mmlNm :family, @family if @family xb.mmlNm :middle, @middle if @middle xb.mmlNm :given, @given if @given xb.mmlNm :fullname, @fullname if @fullname xb.mmlNm :prefix, @prefix if @prefix xb.mmlNm :degree, @degree if @degree end end |