Class: Bogus::Interaction
- Inherits:
-
Struct
- Object
- Struct
- Bogus::Interaction
- Defined in:
- lib/bogus/stubbing/interaction.rb
Defined Under Namespace
Classes: ArgumentComparator, InteractionComparator
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#error ⇒ Object
Returns the value of attribute error.
-
#has_result ⇒ Object
Returns the value of attribute has_result.
-
#method ⇒ Object
Returns the value of attribute method.
-
#return_value ⇒ Object
Returns the value of attribute return_value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(method, args, &block) ⇒ Interaction
constructor
A new instance of Interaction.
Constructor Details
#initialize(method, args, &block) ⇒ Interaction
Returns a new instance of Interaction.
9 10 11 12 13 14 15 16 17 |
# File 'lib/bogus/stubbing/interaction.rb', line 9 def initialize(method, args, &block) self.method = method self.args = args if block_given? evaluate_return_value(block) self.has_result = true end end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args
2 3 4 |
# File 'lib/bogus/stubbing/interaction.rb', line 2 def args @args end |
#arguments ⇒ Object
Returns the value of attribute arguments.
3 4 5 |
# File 'lib/bogus/stubbing/interaction.rb', line 3 def arguments @arguments end |
#error ⇒ Object
Returns the value of attribute error
2 3 4 |
# File 'lib/bogus/stubbing/interaction.rb', line 2 def error @error end |
#has_result ⇒ Object
Returns the value of attribute has_result
2 3 4 |
# File 'lib/bogus/stubbing/interaction.rb', line 2 def has_result @has_result end |
#method ⇒ Object
Returns the value of attribute method
2 3 4 |
# File 'lib/bogus/stubbing/interaction.rb', line 2 def method @method end |
#return_value ⇒ Object
Returns the value of attribute return_value
2 3 4 |
# File 'lib/bogus/stubbing/interaction.rb', line 2 def return_value @return_value end |
Class Method Details
.same?(opts = {}) ⇒ Boolean
5 6 7 |
# File 'lib/bogus/stubbing/interaction.rb', line 5 def self.same?(opts = {}) InteractionComparator.new(opts).same? end |