Class: Dtn::Streaming::RequestBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/dtn/streaming/request_builder.rb

Overview

Request builder abstraction

Defined Under Namespace

Classes: Proxy

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ RequestBuilder

Returns a new instance of RequestBuilder.



32
33
34
# File 'lib/dtn/streaming/request_builder.rb', line 32

def initialize(client:)
  @client = client
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *_args, **_opts, &_blk) ⇒ Object



36
37
38
39
40
# File 'lib/dtn/streaming/request_builder.rb', line 36

def method_missing(method_name, *_args, **_opts, &_blk)
  Proxy.new(client: client, requests_module: _requests_module(method_name))
rescue NameError
  super
end

Instance Method Details

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
45
46
# File 'lib/dtn/streaming/request_builder.rb', line 42

def respond_to_missing?(method_name, include_private = false)
  _requests_module(method_name).is_a? Module
rescue NameError
  super
end