Sha256: 845985f1284faea134c2ef41a1572c69157178cd9a464998e73fbd5d52e1eda0

Contents?: true

Size: 353 Bytes

Versions: 1

Compression:

Stored size: 353 Bytes

Contents

require 'httparty'

module Messenger

  class Web

    def self.send(url, body, options={})
      response = HTTParty.post(url, options.merge(:body => body))
      [success?(response), response]
    end

  private

    def self.success?(response)
      case response.code
      when 200, 201: true
      else
        false
      end
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
messenger-0.0.1 lib/messenger/web.rb