Sha256: e2dae160f8a9ea7b98c61fbced0d69bd448104469f4f3cb6581d7c96382744ba

Contents?: true

Size: 391 Bytes

Versions: 1

Compression:

Stored size: 391 Bytes

Contents

module Messenger

  class Result

    attr_reader :response

    def initialize(success, response)
      @success = success
      @response = response
    end

    def success?
      !!@success
    end

    def code
      response.code rescue nil
    end

    def body
      if response.respond_to?(:body)
        response.body
      else
        response.to_s
      end
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
messenger-0.2.0 lib/messenger/result.rb