Sha256: 6d7d42808fc813e2ff6dc3413bdb6f246723f6c45c89924897c442ecd7cd8a3b

Contents?: true

Size: 928 Bytes

Versions: 4

Compression:

Stored size: 928 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
  AUTHORIZE_ENDPOINT  = 'https://open.weixin.qq.com/connect/oauth2/authorize'.freeze
  ACCESS_TOKEN_PREFIX = 'WX_TOKEN'.freeze
  JSAPI_TOKEN_PREFIX  = 'WX_JST'.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

4 entries across 4 versions & 1 rubygems

Version Path
wework-0.1.9 lib/wework.rb
wework-0.1.8 lib/wework.rb
wework-0.1.7 lib/wework.rb
wework-0.1.6 lib/wework.rb