Class: Wework::Api::Agent

Inherits:
Base
  • Object
show all
Includes:
Methods::Agent, Methods::Approval, Methods::Checkin, Methods::Menu, Methods::Message
Defined in:
lib/wework/api/agent.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#corp_id, #options, #secret

Instance Method Summary collapse

Methods included from Methods::Approval

#get_approval_data

Methods included from Methods::Checkin

#get_checkin_data

Methods included from Methods::Menu

#menu_create, #menu_delete, #menu_get

Methods included from Methods::Message

#file_message_send, #image_message_send, #miniprogram_message_send, #news_message_send, #text_message_send, #textcard_message_send, #video_message_send, #voice_message_send

Methods included from Methods::Agent

#authorize_url, #get_agent, #get_jssign_package, #get_oauth_userinfo, #get_session_with_jscode, #get_user_detail, #set_agent

Methods inherited from Base

#access_token, #get, #post, #post_file, #request, #valid?

Methods included from Methods::Department

#department_create, #department_delete, #department_list, #department_update

Methods included from Methods::User

#user_batchdelete, #user_create, #user_delete, #user_get, #user_list, #user_simplelist, #user_update

Methods included from Methods::Media

#get_media_url, #media_get, #media_upload

Constructor Details

#initialize(options = {}) ⇒ Agent

Returns a new instance of Agent.



13
14
15
16
17
# File 'lib/wework/api/agent.rb', line 13

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

Instance Attribute Details

#agent_idObject (readonly)

Returns the value of attribute agent_id.



11
12
13
# File 'lib/wework/api/agent.rb', line 11

def agent_id
  @agent_id
end

Instance Method Details

#jsapi_ticketObject



19
20
21
# File 'lib/wework/api/agent.rb', line 19

def jsapi_ticket
  jsticket_store.ticket
end