Class: HttpStub::Configurer::PatientCommandChain
- Inherits:
-
Object
- Object
- HttpStub::Configurer::PatientCommandChain
- Defined in:
- lib/http_stub/configurer/patient_command_chain.rb
Instance Method Summary collapse
- #<<(command) ⇒ Object
- #execute ⇒ Object
- #filter(&block) ⇒ Object
-
#initialize(commands = []) ⇒ PatientCommandChain
constructor
A new instance of PatientCommandChain.
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 |
#execute ⇒ Object
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 |