Class: Geminabox::Proxy::Hostess

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/geminabox/proxy/hostess.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#file_handlerObject

Returns the value of attribute file_handler.



7
8
9
# File 'lib/geminabox/proxy/hostess.rb', line 7

def file_handler
  @file_handler
end

Instance Method Details

#serveObject



9
10
11
12
13
14
15
# File 'lib/geminabox/proxy/hostess.rb', line 9

def serve
  if file_handler
    send_file file_handler.proxy_path
  else
    send_file(File.expand_path(File.join(Server.data, *request.path_info)), :type => response['Content-Type'])
  end
end