Class: Ocular::Inputs::HTTP::Input::WebRunContext
- Inherits:
-
DSL::RunContext
- Object
- DSL::RunContext
- Ocular::Inputs::HTTP::Input::WebRunContext
- Includes:
- ErrorDSL
- Defined in:
- lib/ocular/inputs/http_input.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
Returns the value of attribute env.
-
#params ⇒ Object
Returns the value of attribute params.
-
#request ⇒ Object
Returns the value of attribute request.
-
#response ⇒ Object
Returns the value of attribute response.
Attributes inherited from DSL::RunContext
#class_name, #event_signature, #logger, #proxy, #run_id
Instance Method Summary collapse
- #content_type(type) ⇒ Object
- #exec_wrapper(res) ⇒ Object
-
#initialize ⇒ WebRunContext
constructor
A new instance of WebRunContext.
Methods inherited from DSL::RunContext
#after_fork, #cleanup, #method_missing, #register_cleanup
Methods included from Cron::DSL
Methods included from DSL::File
Methods included from DSL::Cache
Methods included from DSL::Graphite
#graphite, #graphite_get_latests
Methods included from DSL::RabbitMQ
Methods included from DSL::Mongo
Methods included from DSL::MySQL
Methods included from DSL::Orbit
Methods included from DSL::Etcd
#etcd, #locked?, #ttl_lock, #unlock
Methods included from DSL::Fog
#autoscaling, #aws, #find_server_by_id, #find_server_by_ip, #find_servers_in_autoscaling_groups, #get_servers_in_autoscaling_group
Methods included from DSL::SSH
Methods included from DSL::Logging
#debug, #error, #fatal, #info, #log_cause, #log_event, #log_timing, #warn
Constructor Details
#initialize ⇒ WebRunContext
Returns a new instance of WebRunContext.
72 73 74 75 |
# File 'lib/ocular/inputs/http_input.rb', line 72 def initialize() super(Ocular::Logging::ConsoleLogger.new) @headers = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Ocular::DSL::RunContext
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env.
68 69 70 |
# File 'lib/ocular/inputs/http_input.rb', line 68 def env @env end |
#params ⇒ Object
Returns the value of attribute params.
68 69 70 |
# File 'lib/ocular/inputs/http_input.rb', line 68 def params @params end |
#request ⇒ Object
Returns the value of attribute request.
68 69 70 |
# File 'lib/ocular/inputs/http_input.rb', line 68 def request @request end |
#response ⇒ Object
Returns the value of attribute response.
68 69 70 |
# File 'lib/ocular/inputs/http_input.rb', line 68 def response @response end |
Instance Method Details
#content_type(type) ⇒ Object
77 78 79 |
# File 'lib/ocular/inputs/http_input.rb', line 77 def content_type(type) @headers["Content-Type"] = type end |
#exec_wrapper(res) ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/ocular/inputs/http_input.rb', line 81 def exec_wrapper(res) if Fixnum === res res = [res, @headers, nil] end if String === res res = [200, @headers, res] end return res end |