Class: RSpec::Mocks::Implementation

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/mocks/message_expectation.rb

Overview

Represents a configured implementation. Takes into account any number of sub-implementations.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) initial_action

Returns the value of attribute initial_action



577
578
579
# File 'lib/rspec/mocks/message_expectation.rb', line 577

def initial_action
  @initial_action
end

- (Object) inner_action

Returns the value of attribute inner_action



577
578
579
# File 'lib/rspec/mocks/message_expectation.rb', line 577

def inner_action
  @inner_action
end

- (Object) terminal_action

Returns the value of attribute terminal_action



577
578
579
# File 'lib/rspec/mocks/message_expectation.rb', line 577

def terminal_action
  @terminal_action
end

Instance Method Details

- (Object) call(*args, &block)



579
580
581
582
583
# File 'lib/rspec/mocks/message_expectation.rb', line 579

def call(*args, &block)
  actions.map do |action|
    action.call(*args, &block)
  end.last
end

- (Boolean) present?



585
586
587
# File 'lib/rspec/mocks/message_expectation.rb', line 585

def present?
  actions.any?
end