Class: ContextIO::Lite

Inherits:
Object
  • Object
show all
Includes:
ContextIO
Defined in:
lib/contextio/lite.rb,
lib/contextio/lite/api.rb,
lib/contextio/lite/user.rb,
lib/contextio/lite/folder.rb,
lib/contextio/lite/message.rb,
lib/contextio/lite/webhook.rb,
lib/contextio/lite/url_builder.rb,
lib/contextio/lite/email_account.rb,
lib/contextio/lite/user_collection.rb,
lib/contextio/lite/folder_collection.rb,
lib/contextio/lite/message_collection.rb,
lib/contextio/lite/webhook_collection.rb,
lib/contextio/lite/email_account_collection.rb

Defined Under Namespace

Classes: API, EmailAccount, EmailAccountCollection, Folder, FolderCollection, Message, MessageCollection, URLBuilder, User, UserCollection, Webhook, WebhookCollection

Constant Summary

Constants included from ContextIO

VERSION

Instance Attribute Summary

Attributes included from ContextIO

#api

Instance Method Summary collapse

Methods included from ContextIO

lite, version

Constructor Details

#initialize(key, secret, opts = {}) ⇒ Lite

Creates a new ‘ContextIO` instance and makes a new handle for the API. This is your entry point to your Context.IO account. For a web app, you probably want to instantiate this in some kind of initializer and keep it around for the life of the process.

Parameters:

  • key (String)

    Your OAuth consumer key for your Context.IO account

  • secret (String)

    Your OAuth consumer secret for your Context.IO account

  • opts (Hash) (defaults to: {})

    Optional options for OAuth connections. ie. :timeout and :open_timeout are supported



14
15
16
# File 'lib/contextio/lite.rb', line 14

def initialize(key, secret, opts={})
  @api = API.new(key, secret, opts)
end

Instance Method Details

#usersUsers

Your entry point for dealing with users.

Returns:

  • (Users)

    Allows you to work with the email accounts for your account as a group.



22
23
24
# File 'lib/contextio/lite.rb', line 22

def users
  UserCollection.new(api)
end