Class: Roqua::Healthy::A19::AddressParser
- Inherits:
-
Object
- Object
- Roqua::Healthy::A19::AddressParser
- Defined in:
- lib/roqua/healthy/a19/address_parser.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #address_type ⇒ Object
- #city ⇒ Object
- #country ⇒ Object
-
#initialize(message) ⇒ AddressParser
constructor
A new instance of AddressParser.
- #record ⇒ Object
- #street ⇒ Object
- #zipcode ⇒ Object
Constructor Details
#initialize(message) ⇒ AddressParser
Returns a new instance of AddressParser.
7 8 9 |
# File 'lib/roqua/healthy/a19/address_parser.rb', line 7 def initialize() = end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/roqua/healthy/a19/address_parser.rb', line 5 def end |
Instance Method Details
#address_type ⇒ Object
11 12 13 14 |
# File 'lib/roqua/healthy/a19/address_parser.rb', line 11 def address_type return nil unless record record.fetch('PID.11.7') end |
#city ⇒ Object
21 22 23 24 |
# File 'lib/roqua/healthy/a19/address_parser.rb', line 21 def city return nil unless record record.fetch('PID.11.3') end |
#country ⇒ Object
31 32 33 34 |
# File 'lib/roqua/healthy/a19/address_parser.rb', line 31 def country return nil unless record record.fetch('PID.11.6') end |
#record ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/roqua/healthy/a19/address_parser.rb', line 36 def record @record = nil @record ||= .fetch('PID').fetch('PID.11').find { |record| record.fetch('PID.11.7', :unknown_type_of_address_record) == 'M' } @record ||= .fetch('PID').fetch('PID.11').find { |record| record.fetch('PID.11.7', :unknown_type_of_address_record) == 'H' } @record ||= .fetch('PID').fetch('PID.11').find { |record| record.fetch('PID.11.7', :unknown_type_of_address_record) == 'L' } @record end |
#street ⇒ Object
16 17 18 19 |
# File 'lib/roqua/healthy/a19/address_parser.rb', line 16 def street return nil if record.blank? || record.fetch('PID.11.1').blank? record.fetch('PID.11.1').fetch('PID.11.1.1') end |
#zipcode ⇒ Object
26 27 28 29 |
# File 'lib/roqua/healthy/a19/address_parser.rb', line 26 def zipcode return nil unless record record.fetch('PID.11.5') end |