Module: ChatWork

Defined in:
lib/chatwork.rb,
lib/chatwork/me.rb,
lib/chatwork/file.rb,
lib/chatwork/room.rb,
lib/chatwork/task.rb,
lib/chatwork/token.rb,
lib/chatwork/client.rb,
lib/chatwork/member.rb,
lib/chatwork/message.rb,
lib/chatwork/my_task.rb,
lib/chatwork/version.rb,
lib/chatwork/contacts.rb,
lib/chatwork/converter.rb,
lib/chatwork/multipart.rb,
lib/chatwork/my_status.rb,
lib/chatwork/base_client.rb,
lib/chatwork/oauth_client.rb,
lib/chatwork/chatwork_error.rb,
lib/chatwork/invitation_link.rb,
lib/chatwork/incoming_request.rb

Defined Under Namespace

Modules: Contacts, Converter, File, IncomingRequest, InvitationLink, Me, Member, Message, MyStatus, MyTask, Room, Task, Token Classes: APIConnectionError, APIError, AuthenticateError, BaseClient, ChatWorkError, Client, EpiloguePart, Multipart, OAuthClient

Constant Summary collapse

VERSION =
"0.12.1".freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_baseObject

Returns the value of attribute api_base.



43
44
45
# File 'lib/chatwork.rb', line 43

def api_base
  @api_base
end

.api_versionObject

Returns the value of attribute api_version.



51
52
53
# File 'lib/chatwork.rb', line 51

def api_version
  @api_version
end

.oauth_api_baseObject

Returns the value of attribute oauth_api_base.



47
48
49
# File 'lib/chatwork.rb', line 47

def oauth_api_base
  @oauth_api_base
end

Class Method Details

.access_tokenString

Note:

if access_token is not defined, returns ENV["CHATWORK_ACCESS_TOKEN"]

Returns:

  • (String)


117
118
119
# File 'lib/chatwork.rb', line 117

def access_token
  @access_token || ENV["CHATWORK_ACCESS_TOKEN"]
end

.access_token=(new_value) ⇒ Object

Parameters:

  • new_value (String)


89
90
91
92
93
# File 'lib/chatwork.rb', line 89

def access_token=(new_value)
  @api_key = nil
  @access_token = new_value
  @client = nil
end

.api_keyString

Note:

if api_key is not defined, returns ENV["CHATWORK_API_TOKEN"]

Returns:

  • (String)


110
111
112
# File 'lib/chatwork.rb', line 110

def api_key
  @api_key || ENV["CHATWORK_API_TOKEN"]
end

.api_key=(new_value) ⇒ Object

Parameters:

  • new_value (String)


82
83
84
85
86
# File 'lib/chatwork.rb', line 82

def api_key=(new_value)
  @api_key = new_value
  @access_token = nil
  @client = nil
end

.clientChatWork::Client

Returns:



54
55
56
# File 'lib/chatwork.rb', line 54

def client
  @client ||= Client.new(api_key: api_key, access_token: access_token)
end

.client_idString

Note:

if client_id is not defined, returns ENV["CHATWORK_CLIENT_ID"]

Returns:

  • (String)


124
125
126
# File 'lib/chatwork.rb', line 124

def client_id
  @client_id || ENV["CHATWORK_CLIENT_ID"]
end

.client_id=(new_value) ⇒ Object

Parameters:

  • new_value (String)


96
97
98
99
# File 'lib/chatwork.rb', line 96

def client_id=(new_value)
  @client_id = new_value
  @oauth_client = nil
end

.client_secretString

Note:

if client_secret is not defined, returns ENV["CHATWORK_CLIENT_SECRET"]

Returns:

  • (String)


131
132
133
# File 'lib/chatwork.rb', line 131

def client_secret
  @client_secret || ENV["CHATWORK_CLIENT_SECRET"]
end

.client_secret=(new_value) ⇒ Object

Parameters:

  • new_value (String)


102
103
104
105
# File 'lib/chatwork.rb', line 102

def client_secret=(new_value)
  @client_secret = new_value
  @oauth_client = nil
end

.oauth_clientChatWork::OAuthClient



59
60
61
# File 'lib/chatwork.rb', line 59

def oauth_client
  @oauth_client ||= OAuthClient.new(client_id: client_id, client_secret: client_secret)
end