Class: VcrStripeWebhook::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/vcr_stripe_webhook/server.rb

Overview

Tiny web server for stripe webhook

Defined Under Namespace

Classes: RequestParser

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#portObject (readonly)

Returns the value of attribute port.



8
9
10
# File 'lib/vcr_stripe_webhook/server.rb', line 8

def port
  @port
end

#tcp_serverObject (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

#closeObject



14
15
16
17
# File 'lib/vcr_stripe_webhook/server.rb', line 14

def close
  logger.info "Closing Server"
  tcp_server.close
end

#joinObject



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