Class: RSpec::Contracts::InterfaceProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/contracts/interface_proxy.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(interface_name, proxied_class) ⇒ InterfaceProxy

Returns a new instance of InterfaceProxy.



6
7
8
9
10
# File 'lib/rspec/contracts/interface_proxy.rb', line 6

def initialize(interface_name, proxied_class)
  proxied_class.instance_methods.select{|m| proxyable_method? m}.each do |method_name|
    MethodProxy.create interface_name, proxied_class, method_name
  end
end

Class Method Details

.create(*args) ⇒ Object



16
17
18
# File 'lib/rspec/contracts/interface_proxy.rb', line 16

def self.create(*args)
  new(*args)
end

Instance Method Details

#proxyable_method?(method_name) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/rspec/contracts/interface_proxy.rb', line 12

def proxyable_method?(method_name)
  true
end