Class: MockServer::HttpClassCallback
- Inherits:
-
Object
- Object
- MockServer::HttpClassCallback
- Defined in:
- lib/mockserver/models.rb
Instance Attribute Summary collapse
-
#callback_class ⇒ Object
Returns the value of attribute callback_class.
-
#delay ⇒ Object
Returns the value of attribute delay.
-
#primary ⇒ Object
Returns the value of attribute primary.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(callback_class: nil, delay: nil, primary: nil) ⇒ HttpClassCallback
constructor
A new instance of HttpClassCallback.
- #to_h ⇒ Object
Constructor Details
#initialize(callback_class: nil, delay: nil, primary: nil) ⇒ HttpClassCallback
Returns a new instance of HttpClassCallback.
1157 1158 1159 1160 1161 |
# File 'lib/mockserver/models.rb', line 1157 def initialize(callback_class: nil, delay: nil, primary: nil) @callback_class = callback_class @delay = delay @primary = primary end |
Instance Attribute Details
#callback_class ⇒ Object
Returns the value of attribute callback_class.
1155 1156 1157 |
# File 'lib/mockserver/models.rb', line 1155 def callback_class @callback_class end |
#delay ⇒ Object
Returns the value of attribute delay.
1155 1156 1157 |
# File 'lib/mockserver/models.rb', line 1155 def delay @delay end |
#primary ⇒ Object
Returns the value of attribute primary.
1155 1156 1157 |
# File 'lib/mockserver/models.rb', line 1155 def primary @primary end |
Class Method Details
.callback(callback_class: nil) ⇒ Object
1181 1182 1183 |
# File 'lib/mockserver/models.rb', line 1181 def self.callback(callback_class: nil) new(callback_class: callback_class) end |
Instance Method Details
#to_h ⇒ Object
1163 1164 1165 1166 1167 1168 1169 |
# File 'lib/mockserver/models.rb', line 1163 def to_h MockServer.strip_none({ 'callbackClass' => @callback_class, 'delay' => @delay&.to_h, 'primary' => @primary }) end |