Sha256: b54b295e6e9e8d14746470daf9373fa8f116383369cc96606a242e703a40b4e9
Contents?: true
Size: 870 Bytes
Versions: 19
Compression:
Stored size: 870 Bytes
Contents
module Runcible class Response attr_accessor :rest_client_response, :parsed_body def initialize(parsed_body, rest_client_response) @rest_client_response = rest_client_response @parsed_body = parsed_body end def respond_to?(name) @parsed_body.respond_to?(name) || @rest_client_response.respond_to?(name) end def ==(other) self.parsed_body == other end def is_a?(clazz) self.parsed_body.is_a?(clazz) end def body @parsed_body end def to_hash self.parsed_body.try(:to_hash) end 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 end end
Version data entries
19 entries across 19 versions & 1 rubygems