Class: MailToHipChat::RackApp::Builder
- Inherits:
-
Object
- Object
- MailToHipChat::RackApp::Builder
- Defined in:
- lib/mail_to_hip_chat/rack_app/builder.rb
Instance Attribute Summary collapse
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#mount_point ⇒ Object
Returns the value of attribute mount_point.
-
#rooms ⇒ Object
Returns the value of attribute rooms.
-
#secret ⇒ Object
Returns the value of attribute secret.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Builder
constructor
A new instance of Builder.
- #to_app ⇒ Object
- #use_chute(chute_klass) ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ Builder
Returns a new instance of Builder.
11 12 13 14 15 |
# File 'lib/mail_to_hip_chat/rack_app/builder.rb', line 11 def initialize @chutes = [] @mount_point = '/notifications/create' yield(self) if block_given? end |
Instance Attribute Details
#api_token ⇒ Object
Returns the value of attribute api_token.
9 10 11 |
# File 'lib/mail_to_hip_chat/rack_app/builder.rb', line 9 def api_token @api_token end |
#mount_point ⇒ Object
Returns the value of attribute mount_point.
9 10 11 |
# File 'lib/mail_to_hip_chat/rack_app/builder.rb', line 9 def mount_point @mount_point end |
#rooms ⇒ Object
Returns the value of attribute rooms.
9 10 11 |
# File 'lib/mail_to_hip_chat/rack_app/builder.rb', line 9 def rooms @rooms end |
#secret ⇒ Object
Returns the value of attribute secret.
9 10 11 |
# File 'lib/mail_to_hip_chat/rack_app/builder.rb', line 9 def secret @secret end |
Instance Method Details
#to_app ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/mail_to_hip_chat/rack_app/builder.rb', line 21 def to_app return @app if @app app = build_app mnt = mount_point @app = Rack::Builder.new do use Rack::CommonLogger map(mnt) { run app } end.to_app end |
#use_chute(chute_klass) ⇒ Object
17 18 19 |
# File 'lib/mail_to_hip_chat/rack_app/builder.rb', line 17 def use_chute(chute_klass) @chutes << chute_klass end |