Module: Typetalk

Defined in:
lib/typetalk.rb,
lib/typetalk/api.rb,
lib/typetalk/error.rb,
lib/typetalk/version.rb,
lib/typetalk/api/auth.rb,
lib/typetalk/api/user.rb,
lib/typetalk/api/topic.rb,
lib/typetalk/connection.rb,
lib/typetalk/api/mention.rb,
lib/typetalk/api/message.rb,
lib/typetalk/api/notification.rb

Defined Under Namespace

Modules: Connection Classes: Api, InvalidFileSize, InvalidRequest, NotFound, Unauthorized

Constant Summary collapse

DEFAULT_OPTIONS =
{
  client_id: ENV['TYPETALK_CLIENT_ID'],
  client_secret: ENV['TYPETALK_CLIENT_SECRET'],
  redirect_uri: nil,
  grant_type: 'client_credentials', # or 'authorization_code'
  scope: 'topic.read,topic.post,my',
  endpoint: 'https://typetalk.com/api/v1',
  proxy: nil,
  user_agent: "Typetalk Rubygem #{Typetalk::VERSION}",
}
VERSION =
"0.0.6"

Class Method Summary collapse

Class Method Details

.configObject



23
24
25
# File 'lib/typetalk.rb', line 23

def config
  @config ||= Hashie::Mash.new(Typetalk::DEFAULT_OPTIONS)
end

.configure {|config| ... } ⇒ Object

Yields:



31
32
33
# File 'lib/typetalk.rb', line 31

def configure
  yield config
end

.reset_configObject



27
28
29
# File 'lib/typetalk.rb', line 27

def reset_config
  @config = nil
end