Class: SsciInc::PersonName
- Inherits:
-
Object
- Object
- SsciInc::PersonName
- Defined in:
- lib/ssci_inc/person_name.rb
Instance Attribute Summary collapse
-
#affix ⇒ Object
Returns the value of attribute affix.
-
#family_name ⇒ Object
Returns the value of attribute family_name.
-
#given_name ⇒ Object
Returns the value of attribute given_name.
-
#middle_name ⇒ Object
Returns the value of attribute middle_name.
Instance Method Summary collapse
- #as_xml ⇒ Object
-
#initialize(h = {}) ⇒ PersonName
constructor
A new instance of PersonName.
- #to_xml ⇒ Object
Constructor Details
#initialize(h = {}) ⇒ PersonName
Returns a new instance of PersonName.
9 10 11 |
# File 'lib/ssci_inc/person_name.rb', line 9 def initialize(h={}) h.each {|k,v| send("#{k}=", v) if respond_to?("#{k}=") } end |
Instance Attribute Details
#affix ⇒ Object
Returns the value of attribute affix.
4 5 6 |
# File 'lib/ssci_inc/person_name.rb', line 4 def affix @affix end |
#family_name ⇒ Object
Returns the value of attribute family_name.
4 5 6 |
# File 'lib/ssci_inc/person_name.rb', line 4 def family_name @family_name end |
#given_name ⇒ Object
Returns the value of attribute given_name.
4 5 6 |
# File 'lib/ssci_inc/person_name.rb', line 4 def given_name @given_name end |
#middle_name ⇒ Object
Returns the value of attribute middle_name.
4 5 6 |
# File 'lib/ssci_inc/person_name.rb', line 4 def middle_name @middle_name end |
Instance Method Details
#as_xml ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ssci_inc/person_name.rb', line 13 def as_xml Nokogiri::XML::Builder.new do |xml| xml.PersonName { xml.GivenName given_name xml.MiddleName middle_name xml.FamilyName family_name xml.Affix affix } end.parent.root end |
#to_xml ⇒ Object
24 25 26 |
# File 'lib/ssci_inc/person_name.rb', line 24 def to_xml as_xml.to_xml end |