Class: MockServer::HttpError
- Inherits:
-
Object
- Object
- MockServer::HttpError
- Defined in:
- lib/mockserver/models.rb
Instance Attribute Summary collapse
-
#delay ⇒ Object
Returns the value of attribute delay.
-
#drop_connection ⇒ Object
Returns the value of attribute drop_connection.
-
#primary ⇒ Object
Returns the value of attribute primary.
-
#response_bytes ⇒ Object
Returns the value of attribute response_bytes.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(drop_connection: nil, response_bytes: nil, delay: nil, primary: nil) ⇒ HttpError
constructor
A new instance of HttpError.
- #to_h ⇒ Object
Constructor Details
#initialize(drop_connection: nil, response_bytes: nil, delay: nil, primary: nil) ⇒ HttpError
Returns a new instance of HttpError.
912 913 914 915 916 917 |
# File 'lib/mockserver/models.rb', line 912 def initialize(drop_connection: nil, response_bytes: nil, delay: nil, primary: nil) @drop_connection = drop_connection @response_bytes = response_bytes @delay = delay @primary = primary end |
Instance Attribute Details
#delay ⇒ Object
Returns the value of attribute delay.
910 911 912 |
# File 'lib/mockserver/models.rb', line 910 def delay @delay end |
#drop_connection ⇒ Object
Returns the value of attribute drop_connection.
910 911 912 |
# File 'lib/mockserver/models.rb', line 910 def drop_connection @drop_connection end |
#primary ⇒ Object
Returns the value of attribute primary.
910 911 912 |
# File 'lib/mockserver/models.rb', line 910 def primary @primary end |
#response_bytes ⇒ Object
Returns the value of attribute response_bytes.
910 911 912 |
# File 'lib/mockserver/models.rb', line 910 def response_bytes @response_bytes end |
Class Method Details
.error ⇒ Object
939 940 941 |
# File 'lib/mockserver/models.rb', line 939 def self.error new end |
.from_hash(data) ⇒ Object
928 929 930 931 932 933 934 935 936 937 |
# File 'lib/mockserver/models.rb', line 928 def self.from_hash(data) return nil if data.nil? new( drop_connection: data['dropConnection'], response_bytes: data['responseBytes'], delay: Delay.from_hash(data['delay']), primary: data['primary'] ) end |
Instance Method Details
#to_h ⇒ Object
919 920 921 922 923 924 925 926 |
# File 'lib/mockserver/models.rb', line 919 def to_h MockServer.strip_none({ 'dropConnection' => @drop_connection, 'responseBytes' => @response_bytes, 'delay' => @delay&.to_h, 'primary' => @primary }) end |