Class: MockServer::CrossProtocolScenario
- Inherits:
-
Object
- Object
- MockServer::CrossProtocolScenario
- Defined in:
- lib/mockserver/models.rb
Overview
Describes a cross-protocol scenario correlation: when a protocol event matching trigger (and optionally match_pattern) is observed, the named scenario scenario_name is advanced to target_state.
Instance Attribute Summary collapse
-
#match_pattern ⇒ Object
Returns the value of attribute match_pattern.
-
#scenario_name ⇒ Object
Returns the value of attribute scenario_name.
-
#target_state ⇒ Object
Returns the value of attribute target_state.
-
#trigger ⇒ Object
Returns the value of attribute trigger.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(trigger: nil, match_pattern: nil, scenario_name: nil, target_state: nil) ⇒ CrossProtocolScenario
constructor
A new instance of CrossProtocolScenario.
- #to_h ⇒ Object
Constructor Details
#initialize(trigger: nil, match_pattern: nil, scenario_name: nil, target_state: nil) ⇒ CrossProtocolScenario
Returns a new instance of CrossProtocolScenario.
1771 1772 1773 1774 1775 1776 |
# File 'lib/mockserver/models.rb', line 1771 def initialize(trigger: nil, match_pattern: nil, scenario_name: nil, target_state: nil) @trigger = trigger @match_pattern = match_pattern @scenario_name = scenario_name @target_state = target_state end |
Instance Attribute Details
#match_pattern ⇒ Object
Returns the value of attribute match_pattern.
1769 1770 1771 |
# File 'lib/mockserver/models.rb', line 1769 def match_pattern @match_pattern end |
#scenario_name ⇒ Object
Returns the value of attribute scenario_name.
1769 1770 1771 |
# File 'lib/mockserver/models.rb', line 1769 def scenario_name @scenario_name end |
#target_state ⇒ Object
Returns the value of attribute target_state.
1769 1770 1771 |
# File 'lib/mockserver/models.rb', line 1769 def target_state @target_state end |
#trigger ⇒ Object
Returns the value of attribute trigger.
1769 1770 1771 |
# File 'lib/mockserver/models.rb', line 1769 def trigger @trigger end |
Class Method Details
.from_hash(data) ⇒ Object
1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 |
# File 'lib/mockserver/models.rb', line 1787 def self.from_hash(data) return nil if data.nil? new( trigger: data['trigger'], match_pattern: data['matchPattern'], scenario_name: data['scenarioName'], target_state: data['targetState'] ) end |
Instance Method Details
#to_h ⇒ Object
1778 1779 1780 1781 1782 1783 1784 1785 |
# File 'lib/mockserver/models.rb', line 1778 def to_h MockServer.strip_none({ 'trigger' => @trigger, 'matchPattern' => @match_pattern, 'scenarioName' => @scenario_name, 'targetState' => @target_state }) end |