Class: PactBroker::Client::Hal::ErrorEntity
- Defined in:
- lib/pact_broker/client/hal/entity.rb
Instance Method Summary collapse
- #assert_success! ⇒ Object
- #does_not_exist? ⇒ Boolean
-
#initialize(href, data, http_client, response = nil) ⇒ ErrorEntity
constructor
A new instance of ErrorEntity.
- #success? ⇒ Boolean
Methods inherited from Entity
#_link, #_link!, #can?, #fetch, #follow, #get, #method_missing, #patch, #post, #put, #respond_to_missing?, #response
Constructor Details
#initialize(href, data, http_client, response = nil) ⇒ ErrorEntity
Returns a new instance of ErrorEntity.
94 95 96 97 98 99 100 |
# File 'lib/pact_broker/client/hal/entity.rb', line 94 def initialize(href, data, http_client, response = nil) @href = href @data = data @links = {} @client = http_client @response = response end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PactBroker::Client::Hal::Entity
Instance Method Details
#assert_success! ⇒ Object
110 111 112 |
# File 'lib/pact_broker/client/hal/entity.rb', line 110 def assert_success! raise ErrorResponseReturned.new("Error retrieving #{@href} status=#{response ? response.code: nil} #{response ? response.raw_body : ''}") end |
#does_not_exist? ⇒ Boolean
102 103 104 |
# File 'lib/pact_broker/client/hal/entity.rb', line 102 def does_not_exist? response && response.status == 404 end |
#success? ⇒ Boolean
106 107 108 |
# File 'lib/pact_broker/client/hal/entity.rb', line 106 def success? false end |