Class: Typekit::Routing::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/typekit/routing/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(owner, **options) ⇒ Proxy

Returns a new instance of Proxy.



4
5
6
7
# File 'lib/typekit/routing/proxy.rb', line 4

def initialize(owner, **options)
  @owner = owner
  @options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *arguments, **options, &block) ⇒ Object



9
10
11
12
13
14
# File 'lib/typekit/routing/proxy.rb', line 9

def method_missing(name, *arguments, **options, &block)
  name = :"define_#{ name }"
  return super unless @owner.respond_to?(name)
  # NOTE: https://bugs.ruby-lang.org/issues/9776
  @owner.send(name, *arguments, **options, **@options, &block)
end