Sha256: a327d95e6fe7944bca5ac7eb2e6e2aa74a11ec6999a308a62501096d0fce9145

Contents?: true

Size: 809 Bytes

Versions: 1

Compression:

Stored size: 809 Bytes

Contents

module Wework
  module Api
    class Agent < Base

      include Methods::Agent
      include Methods::Message
      include Methods::Appchat
      include Methods::Menu
      include Methods::Checkin
      include Methods::Approval

      attr_reader :agent_id

      def initialize(options={})
        @agent_id = options.delete(:agent_id)
        @agent_id = @agent_id.to_i if @agent_id.to_s =~ /\A\d+\Z/
        super(options)
      end

      def jsapi_ticket
        jsticket_store.ticket
      end

      def jsapi_agent_ticket
        jsticket_agent_store.ticket
      end

      private

      def jsticket_store
        @jsticket_store ||= Token::JsTicket.new self
      end

      def jsticket_agent_store
        @jsticket_agent_store ||= Token::JsAgentTicket.new self
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wework-next-1.2.6 lib/wework/api/agent.rb