module ISO
Public Class Methods
new()
click to toggle source
# File lib/divISOr/iso.rb, line 2 def initialize @iso_records = ISORecords.new self.file_data end
Public Instance Methods
all(value, field=:code) { |record| ... }
click to toggle source
# File lib/divISOr/iso.rb, line 10 def all(value, field=:code) @iso_records.all(value, field).map do |record| yield record end end
validate(value, field=:code)
click to toggle source
# File lib/divISOr/iso.rb, line 6 def validate(value, field=:code) !value.nil? && values(field).include?(value.to_s.upcase) end
Protected Instance Methods
file_data()
click to toggle source
# File lib/divISOr/iso.rb, line 22 def file_data File.expand_path(File.dirname(__FILE__) + self.class::PATH) end
Private Instance Methods
values(field)
click to toggle source
# File lib/divISOr/iso.rb, line 17 def values(field) @iso_records.values_for(field) end