Class: Trello::Client
- Inherits:
-
Object
- Object
- Trello::Client
- Defined in:
- lib/trello-client.rb,
lib/trello-client/card.rb,
lib/trello-client/list.rb,
lib/trello-client/board.rb,
lib/trello-client/member.rb,
lib/trello-client/version.rb
Overview
:nodoc:
Defined Under Namespace
Classes: Board, Card, List, Member
Constant Summary collapse
- VERSION =
Trello::Client version
'0.0.6'
Instance Attribute Summary collapse
-
#api ⇒ Object
Get/Set Trello API URL.
-
#api_key ⇒ Object
Get/Set Trello API key.
-
#api_token ⇒ Object
Get/Set Trello API application token.
Instance Method Summary collapse
-
#board(id, options = {}) {|board| ... } ⇒ Object
Get Trello::Client::Board object.
-
#card(id, options = {}) {|card| ... } ⇒ Object
Get Trello::Client::Card object.
-
#initialize {|_self| ... } ⇒ Client
constructor
Initialize Trello::Client object.
-
#list(id, options = {}) {|l| ... } ⇒ Object
Get Trello::Client::List object.
-
#member(id, options = {}) {|m| ... } ⇒ Object
Get Trello::Client::Member object.
Constructor Details
#initialize {|_self| ... } ⇒ Client
Initialize Trello::Client object
143 144 145 146 147 148 149 |
# File 'lib/trello-client.rb', line 143 def initialize @api = 'https://api.trello.com/1' @api_key = nil @api_token = nil yield self if block_given? self end |
Instance Attribute Details
#api ⇒ Object
Get/Set Trello API URL
128 129 130 |
# File 'lib/trello-client.rb', line 128 def api @api end |
#api_key ⇒ Object
Get/Set Trello API key
133 134 135 |
# File 'lib/trello-client.rb', line 133 def api_key @api_key end |
#api_token ⇒ Object
Get/Set Trello API application token
138 139 140 |
# File 'lib/trello-client.rb', line 138 def api_token @api_token end |
Instance Method Details
#board(id, options = {}) {|board| ... } ⇒ Object
Get Trello::Client::Board object
See trello.com/docs/api/board/index.html
Params:
id
-
Board identifier
options
-
(optional) Additional API parameters
160 161 162 163 164 165 |
# File 'lib/trello-client.rb', line 160 def board(id, = {} ) raise('invalid id') if id.nil? || id.empty? board = Trello::Client::Board.new( _get( "#{api}/board/#{id}", ) ) yield board if block_given? board end |
#card(id, options = {}) {|card| ... } ⇒ Object
Get Trello::Client::Card object
See trello.com/docs/api/card/index.html
Params:
id
-
Card identifier
options
-
(optional) Additional API parameters
176 177 178 179 180 181 |
# File 'lib/trello-client.rb', line 176 def card(id, = {} ) raise('invalid id') if id.nil? || id.empty? card = Trello::Client::Card.new( _get( "#{api}/card/#{id}", ) ) yield card if block_given? card end |
#list(id, options = {}) {|l| ... } ⇒ Object
Get Trello::Client::List object
See trello.com/docs/api/list/index.html
Params:
id
-
List identifier
options
-
(optional) Additional API parameters
192 193 194 195 196 197 |
# File 'lib/trello-client.rb', line 192 def list(id, = {} ) raise('invalid id') if id.nil? || id.empty? l = Trello::Client::List.new( _get( "#{api}/list/#{id}", ) ) yield l if block_given? l end |
#member(id, options = {}) {|m| ... } ⇒ Object
Get Trello::Client::Member object
See trello.com/docs/api/member/index.html
Params:
id
-
Member identifier
options
-
(optional) Additional API parameters
209 210 211 212 213 214 |
# File 'lib/trello-client.rb', line 209 def member(id, = {} ) raise('invalid id') if id.nil? || id.empty? m = Trello::Client::Member.new( _get( "#{api}/members/#{id}", ) ) yield m if block_given? m end |