class Runcible::Response

Attributes

parsed_body[RW]
rest_client_response[RW]

Public Class Methods

new(parsed_body, rest_client_response) click to toggle source
# File lib/runcible/response.rb, line 5
def initialize(parsed_body, rest_client_response)
  @rest_client_response = rest_client_response
  @parsed_body = parsed_body
end

Public Instance Methods

==(other) click to toggle source
# File lib/runcible/response.rb, line 14
def ==(other)
  self.parsed_body == other
end
body() click to toggle source
# File lib/runcible/response.rb, line 22
def body
  @parsed_body
end
is_a?(clazz) click to toggle source
# File lib/runcible/response.rb, line 18
def is_a?(clazz)
  self.parsed_body.is_a?(clazz)
end
method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/runcible/response.rb, line 30
def method_missing(name, *args, &block)
  if @parsed_body.respond_to?(name)
    @parsed_body.send(name, *args, &block)
  elsif @rest_client_response.respond_to?(name)
    @rest_client_response.send(name, *args, &block)
  else
    super
  end
end
respond_to?(name) click to toggle source
# File lib/runcible/response.rb, line 10
def respond_to?(name)
  @parsed_body.respond_to?(name) || @rest_client_response.respond_to?(name)
end
to_hash() click to toggle source
# File lib/runcible/response.rb, line 26
def to_hash
  self.parsed_body.try(:to_hash)
end