Ruby - :: in class name Ruby - :: in class name ruby-on-rails ruby-on-rails

Ruby - :: in class name


class Parsers::AdfParser is in practice equivalent to:

module Parsers  class AdfParser

For this to work properly, and the file to be autoloaded its location should be parsers/adf_parser.rb, whether under app/models or lib. Basically the file path needs to mimic the class hierarchy.


It's in the parsers sub-directory of modules; Rails namespaces for you by convention.