Class: Enhance::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/enhance/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



5
6
7
8
9
10
11
12
13
# File 'lib/enhance/config.rb', line 5

def initialize
  @routes       = {}
  @quality      = 100
  @max_side     = 1024
  @command_path = "#{Paperclip.options[:command_path] if defined?(Paperclip)}"
  @extensions   = %w( jpg png jpeg gif )
  
  self.cache    = File.join('tmp', 'enhance')
end

Instance Attribute Details

#cacheObject

Returns the value of attribute cache.



3
4
5
# File 'lib/enhance/config.rb', line 3

def cache
  @cache
end

#command_pathObject

Returns the value of attribute command_path.



3
4
5
# File 'lib/enhance/config.rb', line 3

def command_path
  @command_path
end

#extensionsObject

Returns the value of attribute extensions.



3
4
5
# File 'lib/enhance/config.rb', line 3

def extensions
  @extensions
end

#max_sideObject

Returns the value of attribute max_side.



3
4
5
# File 'lib/enhance/config.rb', line 3

def max_side
  @max_side
end

#qualityObject

Returns the value of attribute quality.



3
4
5
# File 'lib/enhance/config.rb', line 3

def quality
  @quality
end

#routesObject (readonly)

Returns the value of attribute routes.



3
4
5
# File 'lib/enhance/config.rb', line 3

def routes
  @routes
end

#serverObject (readonly)

Returns the value of attribute server.



3
4
5
# File 'lib/enhance/config.rb', line 3

def server
  @server
end

Instance Method Details

#match(route, path) ⇒ Object



15
16
17
# File 'lib/enhance/config.rb', line 15

def match(route, path)
  @routes[route] = path
end