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.
940 941 942 943 944 945 |
# File 'lib/mockserver/models.rb', line 940 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.
938 939 940 |
# File 'lib/mockserver/models.rb', line 938 def delay @delay end |
#drop_connection ⇒ Object
Returns the value of attribute drop_connection.
938 939 940 |
# File 'lib/mockserver/models.rb', line 938 def drop_connection @drop_connection end |
#primary ⇒ Object
Returns the value of attribute primary.
938 939 940 |
# File 'lib/mockserver/models.rb', line 938 def primary @primary end |
#response_bytes ⇒ Object
Returns the value of attribute response_bytes.
938 939 940 |
# File 'lib/mockserver/models.rb', line 938 def response_bytes @response_bytes end |
Class Method Details
.error ⇒ Object
967 968 969 |
# File 'lib/mockserver/models.rb', line 967 def self.error new end |
.from_hash(data) ⇒ Object
956 957 958 959 960 961 962 963 964 965 |
# File 'lib/mockserver/models.rb', line 956 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
947 948 949 950 951 952 953 954 |
# File 'lib/mockserver/models.rb', line 947 def to_h MockServer.strip_none({ 'dropConnection' => @drop_connection, 'responseBytes' => @response_bytes, 'delay' => @delay&.to_h, 'primary' => @primary }) end |