[ rails ] lib files

config/applications.rb

config.autoload_paths += [Rails.root.join('lib')]

lib/whatever.rb

class Whatever
end

lib/whatever/whatever2.rb

class Whatever::Whatever2
def initialize(var1, var2)
end
def callmethod1
end
end

USAGE

Whatever::Whatever2.new(var1, var2)
.callmethod1

ref : http://stackoverflow.com/questions/19098663/auto-loading-lib-files-in-rails-4

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s