Class: ChatSDK::WebhookAccessor

Inherits:
Object
  • Object
show all
Defined in:
lib/chat_sdk/chat.rb

Instance Method Summary collapse

Constructor Details

#initialize(chat, adapters) ⇒ WebhookAccessor

Returns a new instance of WebhookAccessor.



79
80
81
82
83
# File 'lib/chat_sdk/chat.rb', line 79

def initialize(chat, adapters)
  @chat = chat
  @adapters = adapters
  @endpoints = {}
end

Instance Method Details

#[](adapter_name) ⇒ Object



85
86
87
# File 'lib/chat_sdk/chat.rb', line 85

def [](adapter_name)
  @endpoints[adapter_name] ||= Webhook::Endpoint.new(chat: @chat, adapter: @chat.adapter(adapter_name), adapter_name: adapter_name)
end

#routerObject



89
90
91
# File 'lib/chat_sdk/chat.rb', line 89

def router
  @router ||= Webhook::Router.new(@chat, @adapters)
end