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.
892 893 894 895 896 897 |
# File 'lib/mockserver/models.rb', line 892 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.
890 891 892 |
# File 'lib/mockserver/models.rb', line 890 def delay @delay end |
#drop_connection ⇒ Object
Returns the value of attribute drop_connection.
890 891 892 |
# File 'lib/mockserver/models.rb', line 890 def drop_connection @drop_connection end |
#primary ⇒ Object
Returns the value of attribute primary.
890 891 892 |
# File 'lib/mockserver/models.rb', line 890 def primary @primary end |
#response_bytes ⇒ Object
Returns the value of attribute response_bytes.
890 891 892 |
# File 'lib/mockserver/models.rb', line 890 def response_bytes @response_bytes end |
Class Method Details
.error ⇒ Object
919 920 921 |
# File 'lib/mockserver/models.rb', line 919 def self.error new end |
.from_hash(data) ⇒ Object
908 909 910 911 912 913 914 915 916 917 |
# File 'lib/mockserver/models.rb', line 908 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
899 900 901 902 903 904 905 906 |
# File 'lib/mockserver/models.rb', line 899 def to_h MockServer.strip_none({ 'dropConnection' => @drop_connection, 'responseBytes' => @response_bytes, 'delay' => @delay&.to_h, 'primary' => @primary }) end |