Method: Farcall::Provider#initialize
- Defined in:
- lib/farcall/endpoint.rb
#initialize(endpoint: nil, transport: nil, **params) ⇒ Provider
Create an instance connected to the Farcall::Transport or Farcall::Endpoint - use what suites you better.
Please remember that Farcall::Transport instance could be used with only one connected object, unlike Farcall::Endpoint, which could be connected to several consumers.
265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/farcall/endpoint.rb', line 265 def initialize endpoint: nil, transport: nil, **params if endpoint || transport || params.size > 0 @endpoint = if endpoint endpoint else transport ||= Farcall::Transport.create **params Farcall::Endpoint.new transport end @endpoint.provider = self end end |