Class: Pact::Hal::ErrorEntity
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, #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.
93 94 95 96 97 98 99 |
# File 'lib/pact/hal/entity.rb', line 93 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 Pact::Hal::Entity
Instance Method Details
#assert_success! ⇒ Object
105 106 107 |
# File 'lib/pact/hal/entity.rb', line 105 def assert_success! raise ErrorResponseReturned.new("Error retrieving #{@href} status=#{response ? response.code: nil} #{response ? response.raw_body : ''}") end |
#success? ⇒ Boolean
101 102 103 |
# File 'lib/pact/hal/entity.rb', line 101 def success? false end |