Class: RSpec::Contracts::InterfaceProxy
- Inherits:
-
Object
- Object
- RSpec::Contracts::InterfaceProxy
- Defined in:
- lib/rspec/contracts/interface_proxy.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(interface, proxied_class) ⇒ InterfaceProxy
constructor
A new instance of InterfaceProxy.
- #proxyable_method?(method_name) ⇒ Boolean
Constructor Details
#initialize(interface, proxied_class) ⇒ InterfaceProxy
Returns a new instance of InterfaceProxy.
7 8 9 10 11 12 13 |
# File 'lib/rspec/contracts/interface_proxy.rb', line 7 def initialize(interface, proxied_class) @implementor = Implementor.find_or_create proxied_class @implementor.interface_names << interface.name proxied_class.instance_methods.select{|m| proxyable_method? m}.each do |method_name| MethodProxy.create @implementor, proxied_class, method_name end end |
Class Method Details
.create(*args) ⇒ Object
19 20 21 |
# File 'lib/rspec/contracts/interface_proxy.rb', line 19 def self.create(*args) new(*args) end |
Instance Method Details
#proxyable_method?(method_name) ⇒ Boolean
15 16 17 |
# File 'lib/rspec/contracts/interface_proxy.rb', line 15 def proxyable_method?(method_name) true end |