Sha256: 72ef9074641f940047ab1f4ef46a2b1ad1cd35c2c9d49a4b1c13be6ec3d70a76

Contents?: true

Size: 500 Bytes

Versions: 1

Compression:

Stored size: 500 Bytes

Contents

module MySportsFeeds
  module Response
    class Success
      attr_reader :body, :status

      def initialize(body, status = 200)
        @body   = body
        @status = status
      end

      def success?
        true
      end
    end

    class Error
      attr_reader :status

      def initialize(error, status = 422)
        @error  = error
        @status = status
      end

      def body
        { error: @error }
      end

      def success?
        false
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mysportsfeeds-0.1.0 lib/mysportsfeeds/response.rb