Sha256: f35299d9eb87406817f4a9ae2710ec5981027da1563553b183153634827a62de

Contents?: true

Size: 801 Bytes

Versions: 1

Compression:

Stored size: 801 Bytes

Contents

require 'redis'
require 'active_support/all'
#require 'active_support/core_ext/object/blank'

Dir["#{File.dirname(__FILE__)}/wework/*.rb"].each do |path|
  require path
end

require 'wework/api/base'
require 'wework/api/agent'
require 'wework/api/contact'

module Wework
  API_ENDPOINT        = 'https://qyapi.weixin.qq.com/cgi-bin/'.freeze
  ACCESS_TOKEN_PREFIX = 'WEWORK'.freeze
  CONTACT_AGENT_ID    = 'CONTACT'.freeze
  HTTP_OK_STATUS      = [200, 201].freeze
  SUCCESS_CODE        = 0

  # Exceptions
  class RedisNotConfigException < RuntimeError; end
  class AccessTokenExpiredError < RuntimeError; end
  class ResponseError < StandardError
    attr_reader :error_code
    def initialize(errcode, errmsg='')
      @error_code = errcode
      super "(#{error_code}) #{errmsg}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wework-0.1.2 lib/wework.rb