Class: HttpStub::Configurer::PatientCommandChain

Inherits:
Object
  • Object
show all
Defined in:
lib/http_stub/configurer/patient_command_chain.rb

Instance Method Summary collapse

Constructor Details

#initialize(commands = []) ⇒ PatientCommandChain

Returns a new instance of PatientCommandChain.



6
7
8
# File 'lib/http_stub/configurer/patient_command_chain.rb', line 6

def initialize(commands=[])
  @commands = commands
end

Instance Method Details

#<<(command) ⇒ Object



10
11
12
# File 'lib/http_stub/configurer/patient_command_chain.rb', line 10

def <<(command)
  @commands << command
end

#executeObject



14
15
16
# File 'lib/http_stub/configurer/patient_command_chain.rb', line 14

def execute
  @commands.each(&:execute)
end

#filter(&block) ⇒ Object



18
19
20
# File 'lib/http_stub/configurer/patient_command_chain.rb', line 18

def filter(&block)
  HttpStub::Configurer::PatientCommandChain.new(@commands.select(&block))
end