class Aircraft::Guru

For errata

Public Instance Methods

method_missing(method_id, *args, &block) click to toggle source
Calls superclass method
# File lib/earth/air/aircraft/data_miner.rb, line 4
def method_missing(method_id, *args, &block)
  if method_id.to_s =~ /\A([a-z]+)_is_(?:not_)?([^\?]+)/
    column_name = $1
    value = $2
    value_regexp = /^#{value.gsub('_',' ')}$/i
    # row['Manufacturer'] =~ /mcdonnell douglas/i
    matches = value_regexp.match(args.first[column_name.titleize])
    method_id.to_s.include?('_not_') ? matches.nil? : !matches.nil?
  else
    super
  end
end