Class: HTTPX::Resolver::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/httpx/resolver/options.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Options

Returns a new instance of Options.



5
6
7
# File 'lib/httpx/resolver/options.rb', line 5

def initialize(options = {})
  @options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/httpx/resolver/options.rb', line 9

def method_missing(m, *args, &block)
  if @options.key?(m)
    @options[m]
  else
    super
  end
end

Instance Method Details

#respond_to_missing?(m) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/httpx/resolver/options.rb', line 17

def respond_to_missing?(m)
  @options.key?(m) || super
end

#to_hObject



21
22
23
# File 'lib/httpx/resolver/options.rb', line 21

def to_h
  @options
end