Module: ChatWork

Defined in:
lib/chatwork.rb,
lib/chatwork/me.rb,
lib/chatwork/room.rb,
lib/chatwork/task.rb,
lib/chatwork/token.rb,
lib/chatwork/client.rb,
lib/chatwork/entity.rb,
lib/chatwork/member.rb,
lib/chatwork/message.rb,
lib/chatwork/my_task.rb,
lib/chatwork/version.rb,
lib/chatwork/contacts.rb,
lib/chatwork/operations.rb,
lib/chatwork/base_client.rb,
lib/chatwork/oauth_client.rb,
lib/chatwork/chatwork_error.rb

Defined Under Namespace

Modules: Operations Classes: APIConnectionError, APIError, AuthenticateError, BaseClient, ChatWorkError, Client, Contacts, Entity, Me, Member, Message, MyTask, OAuthClient, Room, Task, Token

Constant Summary collapse

VERSION =
"0.5.0".freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_baseObject

Returns the value of attribute api_base


30
31
32
# File 'lib/chatwork.rb', line 30

def api_base
  @api_base
end

.api_versionObject (readonly)

Returns the value of attribute api_version


34
35
36
# File 'lib/chatwork.rb', line 34

def api_version
  @api_version
end

.oauth_api_baseObject

Returns the value of attribute oauth_api_base


32
33
34
# File 'lib/chatwork.rb', line 32

def oauth_api_base
  @oauth_api_base
end

Class Method Details

.access_tokenObject


80
81
82
# File 'lib/chatwork.rb', line 80

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

.access_token=(new_value) ⇒ Object


60
61
62
63
64
# File 'lib/chatwork.rb', line 60

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

.api_keyObject


76
77
78
# File 'lib/chatwork.rb', line 76

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

.api_key=(new_value) ⇒ Object


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

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

.clientObject


36
37
38
# File 'lib/chatwork.rb', line 36

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

.client_idObject


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

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

.client_id=(new_value) ⇒ Object


66
67
68
69
# File 'lib/chatwork.rb', line 66

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

.client_secretObject


88
89
90
# File 'lib/chatwork.rb', line 88

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

.client_secret=(new_value) ⇒ Object


71
72
73
74
# File 'lib/chatwork.rb', line 71

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

.oauth_clientObject


40
41
42
# File 'lib/chatwork.rb', line 40

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