Class: Gnarly::Environment
- Inherits:
-
Object
- Object
- Gnarly::Environment
- Includes:
- Haml, Provides, Typhoeus, Understands
- Defined in:
- lib/gnarly/haml.rb,
lib/gnarly/typhoeus.rb,
lib/gnarly/environment.rb
Instance Method Summary collapse
- #application ⇒ Object
- #helper(helper = nil, &block) ⇒ Object
-
#initialize(app) ⇒ Environment
constructor
A new instance of Environment.
- #response(response = nil) ⇒ Object
Methods included from Understands
Methods included from Status
#created, #default_content_type, #internal_server_error, #method_not_allowed, #not_acceptable, #not_found, #ok, #pop_default_content_type, #push_default_content_type, #unsupported_media_type
Methods included from Base
#body_charset, #logger, #request, #state
Methods included from Provides
Methods included from Typhoeus
make_headers, make_rack_response, #typhoeus
Methods included from Haml
Constructor Details
#initialize(app) ⇒ Environment
Returns a new instance of Environment.
11 12 13 14 |
# File 'lib/gnarly/environment.rb', line 11 def initialize(app) @application = app push_default_content_type "text/plain" end |
Instance Method Details
#application ⇒ Object
16 17 18 |
# File 'lib/gnarly/environment.rb', line 16 def application() @application end |
#helper(helper = nil, &block) ⇒ Object
20 21 22 23 |
# File 'lib/gnarly/environment.rb', line 20 def helper(helper=nil, &block) helper = Module.new &block if block and not helper extend helper end |
#response(response = nil) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/gnarly/environment.rb', line 25 def response(response=nil) if response @response = response else response end end |