Class: Panthro
- Inherits:
-
Object
- Object
- Panthro
- Defined in:
- lib/panthro.rb
Class Attribute Summary collapse
-
.disable_logs ⇒ Object
Returns the value of attribute disable_logs.
-
.mirror ⇒ Object
Returns the value of attribute mirror.
-
.path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
Class Attribute Details
.disable_logs ⇒ Object
Returns the value of attribute disable_logs.
5 6 7 |
# File 'lib/panthro.rb', line 5 def disable_logs @disable_logs end |
.mirror ⇒ Object
Returns the value of attribute mirror.
5 6 7 |
# File 'lib/panthro.rb', line 5 def mirror @mirror end |
.path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/panthro.rb', line 5 def path @path end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/panthro.rb', line 8 def call env @env = env @file_path = "#{ self.class.path }#{ env['PATH_INFO'] }" @path = @env['PATH_INFO'] @method = @env['REQUEST_METHOD'] return get_from_mirror if (@path == '/' or @path =~ /\/info/) return get_from_cache if File.exist? @file_path get_from_mirror end |