Sha256: 314196409c1aa6962c85763dac2129e7950564872a5901ba019a50ebf3372381

Contents?: true

Size: 672 Bytes

Versions: 17

Compression:

Stored size: 672 Bytes

Contents

module Wework
  class Engine

    attr_reader :corp_id, :corp_secret, :app_id, :app_secret

    def initialize(options={})
      @corp_id = options[:corp_id]
      @corp_secret = options[:corp_secret]
      @app_id = options[:app_id]
      @app_secret = options[:app_secret]
    end

    def contact
      @contact ||= Wework::Api::Contact.new(corp_id, corp_secret) if contact?
    end

    def agent
      @agent ||= Wework::Api::Agent.new(corp_id, app_id, app_secret) if agent?
    end

    private

    def agent?
      corp_id.present? && app_id.present? && app_secret.present?
    end

    def contact?
      corp_id.present? && corp_secret.present?
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
wework-0.3.4 lib/wework/engine.rb
wework-0.3.3 lib/wework/engine.rb
wework-0.3.2 lib/wework/engine.rb
wework-0.3.1 lib/wework/engine.rb
wework-0.3.0 lib/wework/engine.rb
wework-0.2.9 lib/wework/engine.rb
wework-0.2.8 lib/wework/engine.rb
wework-0.2.7 lib/wework/engine.rb
wework-0.2.6 lib/wework/engine.rb
wework-0.2.5 lib/wework/engine.rb
wework-0.2.4 lib/wework/engine.rb
wework-0.2.3 lib/wework/engine.rb
wework-0.2.2 lib/wework/engine.rb
wework-0.2.0 lib/wework/engine.rb
wework-0.1.9 lib/wework/engine.rb
wework-0.1.8 lib/wework/engine.rb
wework-0.1.7 lib/wework/engine.rb