Class: ObjectProtocol::StandIn
- Inherits:
-
Object
- Object
- ObjectProtocol::StandIn
- Defined in:
- lib/object_protocol/stand_in.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(protocol:, name:) ⇒ StandIn
constructor
A new instance of StandIn.
- #sends(message) ⇒ Object
Constructor Details
#initialize(protocol:, name:) ⇒ StandIn
Returns a new instance of StandIn.
7 8 9 10 |
# File 'lib/object_protocol/stand_in.rb', line 7 def initialize(protocol:, name:) @protocol = protocol @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/object_protocol/stand_in.rb', line 5 def name @name end |
Instance Method Details
#sends(message) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/object_protocol/stand_in.rb', line 12 def sends() MessageExpectation.new( protocol: protocol, sender: self, message: ).tap(&protocol.method(:add_expectation)) end |