Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't use class << self for method definitons

  • Loading branch information...
commit 707022ab7fb5459261c1647e58a15044bb2e77fd 1 parent 7cd7d29
@rmehner rmehner authored
Showing with 12 additions and 9 deletions.
  1. +12 −9 lib/transloadit/rails/engine.rb
View
21 lib/transloadit/rails/engine.rb
@@ -28,17 +28,20 @@ class Engine < ::Rails::Engine
class << self
attr_accessor :application
+ end
- def configuration
- if !@configuration || ::Rails.env.development?
- path = application.root.join(CONFIG_PATH)
- erb = ERB.new(path.read)
- erb.filename = path.to_s
- @configuration = YAML.load(erb.result)
- end
-
- @configuration
+ #
+ # Returns the configuration object (read from the YAML config file)
+ #
+ def self.configuration
+ if !@configuration || ::Rails.env.development?
+ path = self.application.root.join(CONFIG_PATH)
+ erb = ERB.new(path.read)
+ erb.filename = path.to_s
+ @configuration = YAML.load(erb.result)
end
+
+ @configuration
end
#
Please sign in to comment.
Something went wrong with that request. Please try again.