-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathagent.rb
More file actions
39 lines (31 loc) · 809 Bytes
/
agent.rb
File metadata and controls
39 lines (31 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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