Class: RulesIO::RailsConfigurator
- Inherits:
-
Object
- Object
- RulesIO::RailsConfigurator
- Defined in:
- lib/rulesio/railtie.rb
Instance Attribute Summary collapse
-
#controller_data(data) ⇒ Object
Returns the value of attribute controller_data.
-
#disable ⇒ Object
Returns the value of attribute disable.
-
#middlewares ⇒ Object
Returns the value of attribute middlewares.
-
#queue(queue, options = {}) ⇒ Object
Returns the value of attribute queue.
-
#queue_options ⇒ Object
Returns the value of attribute queue_options.
-
#token(token) ⇒ Object
Returns the value of attribute token.
-
#webhook_url(webhook_url) ⇒ Object
Returns the value of attribute webhook_url.
Instance Method Summary collapse
- #configuration ⇒ Object
- #disable_sending_events ⇒ Object
- #girl_friday_options(options) ⇒ Object
-
#initialize ⇒ RailsConfigurator
constructor
A new instance of RailsConfigurator.
- #middleware(middleware, &block) ⇒ Object
Constructor Details
#initialize ⇒ RailsConfigurator
Returns a new instance of RailsConfigurator.
7 8 9 10 11 |
# File 'lib/rulesio/railtie.rb', line 7 def initialize @webhook_url = 'https://www.rules.io/events/' @middlewares = {} @disable = false end |
Instance Attribute Details
#controller_data(data) ⇒ Object
Returns the value of attribute controller_data.
6 7 8 |
# File 'lib/rulesio/railtie.rb', line 6 def controller_data @controller_data end |
#disable ⇒ Object
Returns the value of attribute disable.
6 7 8 |
# File 'lib/rulesio/railtie.rb', line 6 def disable @disable end |
#middlewares ⇒ Object
Returns the value of attribute middlewares.
6 7 8 |
# File 'lib/rulesio/railtie.rb', line 6 def middlewares @middlewares end |
#queue(queue, options = {}) ⇒ Object
Returns the value of attribute queue.
6 7 8 |
# File 'lib/rulesio/railtie.rb', line 6 def queue @queue end |
#queue_options ⇒ Object
Returns the value of attribute queue_options.
6 7 8 |
# File 'lib/rulesio/railtie.rb', line 6 def @queue_options end |
#token(token) ⇒ Object
Returns the value of attribute token.
6 7 8 |
# File 'lib/rulesio/railtie.rb', line 6 def token @token end |
#webhook_url(webhook_url) ⇒ Object
Returns the value of attribute webhook_url.
6 7 8 |
# File 'lib/rulesio/railtie.rb', line 6 def webhook_url @webhook_url end |
Instance Method Details
#configuration ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/rulesio/railtie.rb', line 42 def configuration { :webhook_url => @webhook_url, :disable_sending_events => @disable, :token => @token, :queue => @queue, :queue_options => @queue_options, :controller_data => @controller_data } end |
#disable_sending_events ⇒ Object
30 31 32 |
# File 'lib/rulesio/railtie.rb', line 30 def disable_sending_events @disable = true end |
#girl_friday_options(options) ⇒ Object
38 39 40 |
# File 'lib/rulesio/railtie.rb', line 38 def () @girl_friday_options = end |
#middleware(middleware, &block) ⇒ Object
21 22 23 |
# File 'lib/rulesio/railtie.rb', line 21 def middleware(middleware, &block) @middlewares[middleware] = MiddlewareConfigurator.apply(self, &block) end |