class CarBrands

Public Class Methods

brands() click to toggle source
# File lib/carbrands.rb, line 9
def self.brands
        YAML.load_file(File.join(File.dirname(__FILE__),"carbrands/brands.yml"))
end
detect_brand(str) click to toggle source
# File lib/carbrands.rb, line 19
def self.detect_brand(str)
        YAML.load_file(File.join(File.dirname(__FILE__),"carbrands/detectors.yml")).each do |brand,detectors|
                detectors.each do |detector|
                        return brand if str.include? detector
                end
        end
end
models_of(brand) click to toggle source
# File lib/carbrands.rb, line 5
def self.models_of(brand)
        CarBrands.brands[brand.to_s.upcase]
end