Class: PactBroker::Client::Hal::ErrorEntity
- Defined in:
- lib/pact_broker/client/hal/entity.rb
Instance Method Summary collapse
- #assert_success! ⇒ Object
-
#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, #post, #put, #respond_to_missing?, #response
Constructor Details
#initialize(href, data, http_client, response = nil) ⇒ ErrorEntity
Returns a new instance of ErrorEntity.
89 90 91 92 93 94 95 |
# File 'lib/pact_broker/client/hal/entity.rb', line 89 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
101 102 103 |
# File 'lib/pact_broker/client/hal/entity.rb', line 101 def assert_success! raise ErrorResponseReturned.new("Error retrieving #{@href} status=#{response ? response.code: nil} #{response ? response.raw_body : ''}") end |
#success? ⇒ Boolean
97 98 99 |
# File 'lib/pact_broker/client/hal/entity.rb', line 97 def success? false end |