Class: Txgh::Handlers::Triggers::Handler
- Inherits:
-
Object
- Object
- Txgh::Handlers::Triggers::Handler
- Includes:
- ResponseHelpers
- Defined in:
- lib/txgh/handlers/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.
41 42 43 44 45 46 47 |
# File 'lib/txgh/handlers/triggers/handler.rb', line 41 def initialize( = {}) @project = [:project] @repo = [:repo] @branch = Utils.absolute_branch([:branch]) @resource_slug = [:resource_slug] @logger = [:logger] end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
39 40 41 |
# File 'lib/txgh/handlers/triggers/handler.rb', line 39 def branch @branch end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
39 40 41 |
# File 'lib/txgh/handlers/triggers/handler.rb', line 39 def logger @logger end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
39 40 41 |
# File 'lib/txgh/handlers/triggers/handler.rb', line 39 def project @project end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
39 40 41 |
# File 'lib/txgh/handlers/triggers/handler.rb', line 39 def repo @repo end |
#resource_slug ⇒ Object (readonly)
Returns the value of attribute resource_slug.
39 40 41 |
# File 'lib/txgh/handlers/triggers/handler.rb', line 39 def resource_slug @resource_slug end |
Class Method Details
.handle_request(request, logger) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/txgh/handlers/triggers/handler.rb', line 10 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 |