Class: TxghServer::Triggers::Handler
- Inherits:
-
Object
- Object
- TxghServer::Triggers::Handler
- Includes:
- ResponseHelpers
- Defined in:
- lib/txgh-server/triggers/handler.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#resource_slug ⇒ Object
readonly
Returns the value of attribute resource_slug.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Handler
constructor
A new instance of Handler.
Constructor Details
#initialize(options = {}) ⇒ Handler
Returns a new instance of Handler.
43 44 45 46 47 48 49 |
# File 'lib/txgh-server/triggers/handler.rb', line 43 def initialize( = {}) @project = [:project] @repo = [:repo] @branch = Txgh::Utils.absolute_branch([:branch]) @resource_slug = [:resource_slug] @logger = [:logger] end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
41 42 43 |
# File 'lib/txgh-server/triggers/handler.rb', line 41 def branch @branch end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
41 42 43 |
# File 'lib/txgh-server/triggers/handler.rb', line 41 def logger @logger end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
41 42 43 |
# File 'lib/txgh-server/triggers/handler.rb', line 41 def project @project end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
41 42 43 |
# File 'lib/txgh-server/triggers/handler.rb', line 41 def repo @repo end |
#resource_slug ⇒ Object (readonly)
Returns the value of attribute resource_slug.
41 42 43 |
# File 'lib/txgh-server/triggers/handler.rb', line 41 def resource_slug @resource_slug end |
Class Method Details
.handle_request(request, logger) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/txgh-server/triggers/handler.rb', line 12 def handle_request(request, logger) handle_safely do config = Txgh::Config::KeyManager.config_from_project( request.params.fetch('project_slug') ) handler_for(config, request, logger).execute end end |