Module: ONIX::GlnMethods

Included in:
Addressee, Entity, Sender
Defined in:
lib/onix/identifier.rb

Instance Method Summary collapse

Instance Method Details

#glnObject

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_identifierObject

private



148
149
150
# File 'lib/onix/identifier.rb', line 148

def gln_identifier
  self.identifiers.select { |id| id.type.human=="Gln" }.first
end