Class: SepaFileParser::CreditorReferenceInformation
- Inherits:
-
Object
- Object
- SepaFileParser::CreditorReferenceInformation
- Defined in:
- lib/sepa_file_parser/general/creditor_reference_information.rb
Instance Attribute Summary collapse
-
#xml_data ⇒ Object
readonly
Returns the value of attribute xml_data.
Instance Method Summary collapse
- #code_or_proprietary ⇒ Object
- #creditor_reference ⇒ Object
-
#initialize(xml_data) ⇒ CreditorReferenceInformation
constructor
A new instance of CreditorReferenceInformation.
Constructor Details
#initialize(xml_data) ⇒ CreditorReferenceInformation
Returns a new instance of CreditorReferenceInformation.
8 9 10 |
# File 'lib/sepa_file_parser/general/creditor_reference_information.rb', line 8 def initialize(xml_data) @xml_data = xml_data end |
Instance Attribute Details
#xml_data ⇒ Object (readonly)
Returns the value of attribute xml_data.
6 7 8 |
# File 'lib/sepa_file_parser/general/creditor_reference_information.rb', line 6 def xml_data @xml_data end |
Instance Method Details
#code_or_proprietary ⇒ Object
16 17 18 19 20 21 |
# File 'lib/sepa_file_parser/general/creditor_reference_information.rb', line 16 def code_or_proprietary @code_or_proprietary ||= [ xml_data.xpath('Tp/CdOrPrtry/Cd/text()').text, xml_data.xpath('Tp/CdOrPrtry/Prtry/text()').text, ].reject(&:empty?).first.to_s end |
#creditor_reference ⇒ Object
12 13 14 |
# File 'lib/sepa_file_parser/general/creditor_reference_information.rb', line 12 def creditor_reference @creditor_reference ||= xml_data.xpath('Ref/text()').text end |