Class: Twinfield::Customer::RemittanceAdvice
- Inherits:
-
Object
- Object
- Twinfield::Customer::RemittanceAdvice
- Defined in:
- lib/twinfield/customer.rb
Instance Attribute Summary collapse
-
#sendmail ⇒ Object
Returns the value of attribute sendmail.
-
#sendtype ⇒ Object
Returns the value of attribute sendtype.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(sendtype: nil, sendmail: nil) ⇒ RemittanceAdvice
constructor
A new instance of RemittanceAdvice.
- #to_h ⇒ Object (also: #to_hash)
- #to_xml ⇒ Object
Constructor Details
#initialize(sendtype: nil, sendmail: nil) ⇒ RemittanceAdvice
Returns a new instance of RemittanceAdvice.
40 41 42 43 |
# File 'lib/twinfield/customer.rb', line 40 def initialize(sendtype: nil, sendmail: nil) @sendtype = sendtype @sendmail = sendmail end |
Instance Attribute Details
#sendmail ⇒ Object
Returns the value of attribute sendmail.
38 39 40 |
# File 'lib/twinfield/customer.rb', line 38 def sendmail @sendmail end |
#sendtype ⇒ Object
Returns the value of attribute sendtype.
38 39 40 |
# File 'lib/twinfield/customer.rb', line 38 def sendtype @sendtype end |
Class Method Details
.from_xml(nokogiri) ⇒ Object
59 60 61 62 63 64 |
# File 'lib/twinfield/customer.rb', line 59 def self.from_xml(nokogiri) obj = new obj.sendtype = nokogiri.css("sendtype").text obj.sendmail = nokogiri.css("sendmail").text obj end |
Instance Method Details
#to_h ⇒ Object Also known as: to_hash
45 46 47 |
# File 'lib/twinfield/customer.rb', line 45 def to_h {sendtype: sendtype, sendmail: sendmail} end |
#to_xml ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/twinfield/customer.rb', line 50 def to_xml Nokogiri::XML::Builder.new do |xml| xml.remittanceadvice do xml.sendtype sendtype xml.sendmail sendmail end end.doc.root.to_xml end |