Module: ONIX::GlnMethods
Instance Method Summary collapse
-
#gln ⇒ Object
GLN string identifier from identifiers.
-
#gln_identifier ⇒ Object
private.
Instance Method Details
#gln ⇒ Object
GLN string identifier from identifiers
134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/onix/identifier.rb', line 134 def gln if gln_identifier if gln_identifier.value =~ /\d{13}/ gln_identifier.value else puts "Invalid GLN #{gln_identifier.value}" nil end else nil end end |
#gln_identifier ⇒ Object
private
148 149 150 |
# File 'lib/onix/identifier.rb', line 148 def gln_identifier self.identifiers.select { |id| id.type.human=="Gln" }.first end |