Module: Trello

Defined in:
lib/trello.rb,
lib/trello/net.rb,
lib/trello/card.rb,
lib/trello/item.rb,
lib/trello/list.rb,
lib/trello/board.rb,
lib/trello/label.rb,
lib/trello/token.rb,
lib/trello/action.rb,
lib/trello/client.rb,
lib/trello/member.rb,
lib/trello/checklist.rb,
lib/trello/basic_data.rb,
lib/trello/item_state.rb,
lib/trello/association.rb,
lib/trello/has_actions.rb,
lib/trello/notification.rb,
lib/trello/organization.rb,
lib/trello/authorization.rb,
lib/trello/association_proxy.rb,
lib/trello/multi_association.rb

Overview

Ruby wrapper around the Trello API

First, set up your key information. You can get this information by clicking here.

include Trello
include Trello::Authorization

Trello::Authorization.const_set :AuthPolicy, OAuthPolicy

OAuthPolicy.consumer_credential = OAuthCredential.new 'PUBLIC_KEY', 'SECRET'

You can get the key by going to this url in your browser: trello.com/1/connect?key=PUBLIC_KEY_FROM_ABOVE&name=MyApp&response_type=token&scope=read,write,account&expiration=never Only request the permissions you need; i.e., scope=read if you only need read, or scope=write if you only need write. Comma separate scopes you need. If you want your token to expire after 30 days, drop the &expiration=never. Then run the following code, where KEY denotes the key returned from the url above:

OAuthPolicy.token = OAuthCredential.new 'KEY', nil

All the calls this library make to Trello require authentication using these keys. Be sure to protect them.

So lets say you want to get information about the user bobtester. We can do something like this:

bob = Member.find("bobtester")
# Print out his name
puts bob.full_name # "Bob Tester"
# Print his bio
puts bob.bio # A wonderfully delightful test user
# How about a list of his boards?
bob.boards

And so much more. Consult the rest of the documentation for more information.

Feel free to peruse and participate in our Trello board. It’s completely open to the public.

Defined Under Namespace

Modules: Authorization, HasActions Classes: Action, Association, AssociationProxy, BasicData, Board, Card, Checklist, Client, Error, InvalidAccessToken, Item, ItemState, Label, List, Member, MultiAssociation, Notification, Organization, Request, Response, TInternet, Token

Constant Summary collapse

API_VERSION =

Version of the Trello API that we use by default.

1

Class Method Summary collapse

Class Method Details

.loggerObject



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

def self.logger
  @logger ||= Logger.new(STDOUT)
end

.logger=(logger) ⇒ Object



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

def self.logger=(logger)
  @logger = logger
end