Module: ISO

Included in:
ISO10383::Codes, ISO3166::Codes, ISO4217::Codes
Defined in:
lib/divISOr/iso.rb

Instance Method Summary collapse

Instance Method Details

#all(value, field = :code) ⇒ Object



10
11
12
13
14
# File 'lib/divISOr/iso.rb', line 10

def all(value, field=:code)
  @iso_records.all(value, field).map do |record|
    yield record
  end
end

#initializeObject



2
3
4
# File 'lib/divISOr/iso.rb', line 2

def initialize
  @iso_records = ISORecords.new self.file_data
end

#validate(value, field = :code) ⇒ Object



6
7
8
# File 'lib/divISOr/iso.rb', line 6

def validate(value, field=:code)
  !value.nil? && values(field).include?(value.to_s.upcase)
end