Class: RSpec::Contracts::InterfaceFulfillment
- Inherits:
-
Object
- Object
- RSpec::Contracts::InterfaceFulfillment
- Defined in:
- lib/rspec/contracts/interface_fulfillment.rb
Instance Attribute Summary collapse
-
#interface ⇒ Object
readonly
Returns the value of attribute interface.
Instance Method Summary collapse
- #complete? ⇒ Boolean
-
#initialize(interface, implementors) ⇒ InterfaceFulfillment
constructor
A new instance of InterfaceFulfillment.
- #messages_count ⇒ Object
- #unfulfilled_messages ⇒ Object
Constructor Details
#initialize(interface, implementors) ⇒ InterfaceFulfillment
Returns a new instance of InterfaceFulfillment.
6 7 8 9 |
# File 'lib/rspec/contracts/interface_fulfillment.rb', line 6 def initialize(interface, implementors) @interface = interface @implementors = implementors end |
Instance Attribute Details
#interface ⇒ Object (readonly)
Returns the value of attribute interface.
4 5 6 |
# File 'lib/rspec/contracts/interface_fulfillment.rb', line 4 def interface @interface end |
Instance Method Details
#complete? ⇒ Boolean
11 12 13 |
# File 'lib/rspec/contracts/interface_fulfillment.rb', line 11 def complete? .empty? end |
#messages_count ⇒ Object
19 20 21 |
# File 'lib/rspec/contracts/interface_fulfillment.rb', line 19 def interface..count end |
#unfulfilled_messages ⇒ Object
15 16 17 |
# File 'lib/rspec/contracts/interface_fulfillment.rb', line 15 def interface..reject{ |r| fulfilled? r } end |