class Rester::Client::Response

Public Class Methods

new(status, hash={}) click to toggle source
# File lib/rester/client/response.rb, line 4
def initialize(status, hash={})
  @_status = status
  @_data = hash.dup || {}
  Utils.deep_freeze(@_data)
  freeze
end

Public Instance Methods

==(obj) click to toggle source
# File lib/rester/client/response.rb, line 19
def ==(obj)
  @_data == obj
end
successful?() click to toggle source
# File lib/rester/client/response.rb, line 11
def successful?
  @_status && @_status.between?(200, 299)
end
to_h() click to toggle source
# File lib/rester/client/response.rb, line 15
def to_h
  @_data.dup
end

Private Instance Methods

method_missing(meth, *args, &block) click to toggle source
Calls superclass method
# File lib/rester/client/response.rb, line 25
def method_missing(meth, *args, &block)
  if @_data.respond_to?(meth)
    @_data.public_send(meth, *args, &block)
  else
    super
  end
end
respond_to_missing?(meth, include_private=false) click to toggle source
Calls superclass method
# File lib/rester/client/response.rb, line 33
def respond_to_missing?(meth, include_private=false)
  @_data.respond_to?(meth) || super
end