lib/hal_client/representation.rb
# Fetch the representation from origin server if that has not already
# happened.
Fetch the representation from origin server if that has not already
happened.
Fetch the representation from origin server if that has not already happened .
def ensure_reified
      return if @raw
      (fail "unable to make requests due to missing hal client") unless hal_client
      (fail "unable to make requests due to missing href") unless @href
      response = hal_client.get(@href)
      unless response.is_a?(Representation)
        error_message = "Response body wasn't a valid HAL document:\n\n"
        error_message += response.body
        raise InvalidRepresentationError.new(error_message)
      end
      interpret response.raw
    end
def ensure_reified return if @raw ( fail "unable to make requests due to missing hal client" ) unless hal_client ( fail "unable to make requests due to missing href" ) unless @href response = hal_client . get ( @href ) unless response . is_a? ( Representation ) error_message = "Response body wasn't a valid HAL document:\n\n" error_message += response . body raise InvalidRepresentationError . new ( error_message ) end interpret response . raw end
Fetch the representation from origin server if that has not already
happened.
Fetch the representation from origin server if that has not already happened .