find_corde.rb 283 B

123456789101112131415
  1. require './models.rb'
  2. require './db.rb'
  3. search = ARGV[0]
  4. [
  5. @hairscordes,
  6. @topscordes,
  7. @bottomscordes,
  8. @onepiececordes,
  9. @shoescordes
  10. ].each do |by_category|
  11. by_category.each do |corde|
  12. puts "#{corde.name} #{corde.code_name}" if /.*#{search}.*/ =~ corde.name
  13. end
  14. end