Class: MockServer::AfterAction
- Inherits:
-
Object
- Object
- MockServer::AfterAction
- Defined in:
- lib/mockserver/models.rb
Instance Attribute Summary collapse
-
#delay ⇒ Object
Returns the value of attribute delay.
-
#http_class_callback ⇒ Object
Returns the value of attribute http_class_callback.
-
#http_object_callback ⇒ Object
Returns the value of attribute http_object_callback.
-
#http_request ⇒ Object
Returns the value of attribute http_request.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(http_request: nil, http_class_callback: nil, http_object_callback: nil, delay: nil) ⇒ AfterAction
constructor
A new instance of AfterAction.
- #to_h ⇒ Object
Constructor Details
#initialize(http_request: nil, http_class_callback: nil, http_object_callback: nil, delay: nil) ⇒ AfterAction
Returns a new instance of AfterAction.
1152 1153 1154 1155 1156 1157 |
# File 'lib/mockserver/models.rb', line 1152 def initialize(http_request: nil, http_class_callback: nil, http_object_callback: nil, delay: nil) @http_request = http_request @http_class_callback = http_class_callback @http_object_callback = http_object_callback @delay = delay end |
Instance Attribute Details
#delay ⇒ Object
Returns the value of attribute delay.
1150 1151 1152 |
# File 'lib/mockserver/models.rb', line 1150 def delay @delay end |
#http_class_callback ⇒ Object
Returns the value of attribute http_class_callback.
1150 1151 1152 |
# File 'lib/mockserver/models.rb', line 1150 def http_class_callback @http_class_callback end |
#http_object_callback ⇒ Object
Returns the value of attribute http_object_callback.
1150 1151 1152 |
# File 'lib/mockserver/models.rb', line 1150 def http_object_callback @http_object_callback end |
#http_request ⇒ Object
Returns the value of attribute http_request.
1150 1151 1152 |
# File 'lib/mockserver/models.rb', line 1150 def http_request @http_request end |
Class Method Details
.from_hash(data) ⇒ Object
1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 |
# File 'lib/mockserver/models.rb', line 1168 def self.from_hash(data) return nil if data.nil? new( http_request: HttpRequest.from_hash(data['httpRequest']), http_class_callback: HttpClassCallback.from_hash(data['httpClassCallback']), http_object_callback: HttpObjectCallback.from_hash(data['httpObjectCallback']), delay: Delay.from_hash(data['delay']) ) end |
Instance Method Details
#to_h ⇒ Object
1159 1160 1161 1162 1163 1164 1165 1166 |
# File 'lib/mockserver/models.rb', line 1159 def to_h MockServer.strip_none({ 'httpRequest' => @http_request&.to_h, 'httpClassCallback' => @http_class_callback&.to_h, 'httpObjectCallback' => @http_object_callback&.to_h, 'delay' => @delay&.to_h }) end |