class MCC

Public Class Methods

_load_data() click to toggle source
# File lib/mcc-ruby/mcc.rb, line 16
def self._load_data
  @@_load ||= YAML::load_file(File.join(__dir__, 'mcc_codes.yaml'))
end
all() click to toggle source
# File lib/mcc-ruby/mcc.rb, line 4
def self.all
  _load_data.map { |data| MCC::Code.new(data) }
end
code(_code) click to toggle source
# File lib/mcc-ruby/mcc.rb, line 8
def self.code(_code)
  all.find { |mcc| mcc.send('mcc') == _code.to_s }
end
where(_attr) click to toggle source
# File lib/mcc-ruby/mcc.rb, line 12
def self.where(_attr)
  all.select { |mcc| mcc.send(_attr.keys.first.to_s) == _attr.values.first.to_s }
end