Class: VcrStripeWebhook::Server
- Inherits:
-
Object
- Object
- VcrStripeWebhook::Server
- Defined in:
- lib/vcr_stripe_webhook/server.rb
Overview
Tiny web server for stripe webhook
Defined Under Namespace
Classes: RequestParser
Instance Attribute Summary collapse
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#tcp_server ⇒ Object
readonly
Returns the value of attribute tcp_server.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(port = 0, &block) ⇒ Server
constructor
A new instance of Server.
- #join ⇒ Object
- #wait_event(event_type) ⇒ Object
Constructor Details
#initialize(port = 0, &block) ⇒ Server
Returns a new instance of Server.
10 11 12 |
# File 'lib/vcr_stripe_webhook/server.rb', line 10 def initialize(port = 0, &block) run(port, &block) end |
Instance Attribute Details
#port ⇒ Object (readonly)
Returns the value of attribute port.
8 9 10 |
# File 'lib/vcr_stripe_webhook/server.rb', line 8 def port @port end |
#tcp_server ⇒ Object (readonly)
Returns the value of attribute tcp_server.
8 9 10 |
# File 'lib/vcr_stripe_webhook/server.rb', line 8 def tcp_server @tcp_server end |
Instance Method Details
#close ⇒ Object
14 15 16 17 |
# File 'lib/vcr_stripe_webhook/server.rb', line 14 def close logger.info "Closing Server" tcp_server.close end |
#join ⇒ Object
23 24 25 |
# File 'lib/vcr_stripe_webhook/server.rb', line 23 def join @accept_thread.join end |
#wait_event(event_type) ⇒ Object
19 20 21 |
# File 'lib/vcr_stripe_webhook/server.rb', line 19 def wait_event(event_type) @event_waiter.wait(event_type) end |