doc/Trello/Card.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Trello::Card
— Documentation by YARD 0.9.25
</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" />
<link rel="stylesheet" href="../css/common.css" type="text/css" />
<script type="text/javascript">
pathId = "Trello::Card";
relpath = '../';
</script>
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="../class_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="../_index.html">Index (C)</a> »
<span class='title'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span>
»
<span class="title">Card</span>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><h1>Class: Trello::Card
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></li>
<li class="next">Trello::Card</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Includes:</dt>
<dd><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/trello/card.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>A Card is a container that can house checklists and comments; it resides inside a List.</p>
</div>
</div>
<div class="tags">
</div>
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#badges-instance_method" title="#badges (instance method)">#<strong>badges</strong> ⇒ Hash </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#board_id-instance_method" title="#board_id (instance method)">#<strong>board_id</strong> ⇒ String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>A 24-character hex string.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#card_labels-instance_method" title="#card_labels (instance method)">#<strong>card_labels</strong> ⇒ Array<Hash> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#card_members-instance_method" title="#card_members (instance method)">#<strong>card_members</strong> ⇒ Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#closed-instance_method" title="#closed (instance method)">#<strong>closed</strong> ⇒ Boolean </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#cover_image_id-instance_method" title="#cover_image_id (instance method)">#<strong>cover_image_id</strong> ⇒ String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>A 24-character hex string.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#desc-instance_method" title="#desc (instance method)">#<strong>desc</strong> ⇒ String </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#due-instance_method" title="#due (instance method)">#<strong>due</strong> ⇒ Datetime </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#id-instance_method" title="#id (instance method)">#<strong>id</strong> ⇒ String </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#labels-instance_method" title="#labels (instance method)">#<strong>labels</strong> ⇒ Array<Trello::Labels> </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#last_activity_date-instance_method" title="#last_activity_date (instance method)">#<strong>last_activity_date</strong> ⇒ Dateime </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#list_id-instance_method" title="#list_id (instance method)">#<strong>list_id</strong> ⇒ String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>A 24-character hex string.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#member_ids-instance_method" title="#member_ids (instance method)">#<strong>member_ids</strong> ⇒ Array<String> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>An Array of 24-character hex strings.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#name-instance_method" title="#name (instance method)">#<strong>name</strong> ⇒ String </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#pos-instance_method" title="#pos (instance method)">#<strong>pos</strong> ⇒ Float </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#short_id-instance_method" title="#short_id (instance method)">#<strong>short_id</strong> ⇒ Fixnum </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#short_url-instance_method" title="#short_url (instance method)">#<strong>short_url</strong> ⇒ String </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#source_card_id-instance_method" title="#source_card_id (instance method)">#<strong>source_card_id</strong> ⇒ String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>A 24-character hex string.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#source_card_properties-instance_method" title="#source_card_properties (instance method)">#<strong>source_card_properties</strong> ⇒ Array<String> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Array of strings.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#url-instance_method" title="#url (instance method)">#<strong>url</strong> ⇒ String </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
</ul>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></h3>
<p class="inherited"><span class='object_link'><a href="BasicData.html#client-instance_method" title="Trello::BasicData#client (method)">#client</a></span></p>
<h2>
Instance Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#add_attachment-instance_method" title="#add_attachment (instance method)">#<strong>add_attachment</strong>(attachment, name = '') ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Add an attachment to this card.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#add_checklist-instance_method" title="#add_checklist (instance method)">#<strong>add_checklist</strong>(checklist, name: nil, position: nil) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Add a checklist to this card.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#add_comment-instance_method" title="#add_comment (instance method)">#<strong>add_comment</strong>(text) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Add a comment with the supplied text.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#add_label-instance_method" title="#add_label (instance method)">#<strong>add_label</strong>(label) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Add a label.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#add_member-instance_method" title="#add_member (instance method)">#<strong>add_member</strong>(member) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Add a member to this card.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#attachments-instance_method" title="#attachments (instance method)">#<strong>attachments</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Retrieve a list of attachments.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#check_item_states-instance_method" title="#check_item_states (instance method)">#<strong>check_item_states</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#close-instance_method" title="#close (instance method)">#<strong>close</strong> ⇒ Boolean, String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Close the card.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#close!-instance_method" title="#close! (instance method)">#<strong>close!</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#closed%3F-instance_method" title="#closed? (instance method)">#<strong>closed?</strong> ⇒ Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Check if the card is not active anymore.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#comments-instance_method" title="#comments (instance method)">#<strong>comments</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Retrieve a list of comments.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#cover_image-instance_method" title="#cover_image (instance method)">#<strong>cover_image</strong>(params = {}) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns a reference to the cover image attachment.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#create_new_checklist-instance_method" title="#create_new_checklist (instance method)">#<strong>create_new_checklist</strong>(name) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>create a new checklist and add it to this card.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#created_at-instance_method" title="#created_at (instance method)">#<strong>created_at</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Find the creation date.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong> ⇒ String </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Delete this card.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#members-instance_method" title="#members (instance method)">#<strong>members</strong> ⇒ Array<Trello::Member> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns a list of members who are assigned to this card.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#move_to_board-instance_method" title="#move_to_board (instance method)">#<strong>move_to_board</strong>(new_board, new_list = nil) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Move this card to the given board (and optional list on this board).</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#move_to_list-instance_method" title="#move_to_list (instance method)">#<strong>move_to_list</strong>(list) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Move this card to the given list.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#move_to_list_on_any_board-instance_method" title="#move_to_list_on_any_board (instance method)">#<strong>move_to_list_on_any_board</strong>(list_id) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Moves this card to the given list no matter which board it is on.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#remove_attachment-instance_method" title="#remove_attachment (instance method)">#<strong>remove_attachment</strong>(attachment) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Remove an attachment from this card.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#remove_label-instance_method" title="#remove_label (instance method)">#<strong>remove_label</strong>(label) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Remove a label.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#remove_member-instance_method" title="#remove_member (instance method)">#<strong>remove_member</strong>(member) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Remove a member from this card.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#remove_upvote-instance_method" title="#remove_upvote (instance method)">#<strong>remove_upvote</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Recind upvote.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#request_prefix-instance_method" title="#request_prefix (instance method)">#<strong>request_prefix</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>:nodoc:.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#upvote-instance_method" title="#upvote (instance method)">#<strong>upvote</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Current authenticated user upvotes a card.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#valid%3F-instance_method" title="#valid? (instance method)">#<strong>valid?</strong> ⇒ Boolean </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Is the record valid?.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#voters-instance_method" title="#voters (instance method)">#<strong>voters</strong> ⇒ Array<Trello::Member> </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Returns a list of members who have upvoted this card NOTE: this fetches a list each time it's called to avoid case where card is voted (or vote is removed) after card is fetched.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods included from <span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></h3>
<p class="inherited"><span class='object_link'><a href="HasActions.html#actions-instance_method" title="Trello::HasActions#actions (method)">#actions</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></h3>
<p class="inherited"><span class='object_link'><a href="BasicData.html#==-instance_method" title="Trello::BasicData#== (method)">#==</a></span>, <span class='object_link'><a href="BasicData.html#attributes-instance_method" title="Trello::BasicData#attributes (method)">#attributes</a></span>, <span class='object_link'><a href="BasicData.html#client-class_method" title="Trello::BasicData.client (method)">client</a></span>, <span class='object_link'><a href="BasicData.html#collection_name-instance_method" title="Trello::BasicData#collection_name (method)">#collection_name</a></span>, <span class='object_link'><a href="BasicData.html#collection_path-instance_method" title="Trello::BasicData#collection_path (method)">#collection_path</a></span>, <span class='object_link'><a href="BasicData.html#create-class_method" title="Trello::BasicData.create (method)">create</a></span>, <span class='object_link'><a href="BasicData.html#element_name-instance_method" title="Trello::BasicData#element_name (method)">#element_name</a></span>, <span class='object_link'><a href="BasicData.html#element_path-instance_method" title="Trello::BasicData#element_path (method)">#element_path</a></span>, <span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span>, <span class='object_link'><a href="BasicData.html#hash-instance_method" title="Trello::BasicData#hash (method)">#hash</a></span>, <span class='object_link'><a href="BasicData.html#initialize-instance_method" title="Trello::BasicData#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="BasicData.html#many-class_method" title="Trello::BasicData.many (method)">many</a></span>, <span class='object_link'><a href="BasicData.html#one-class_method" title="Trello::BasicData.one (method)">one</a></span>, <span class='object_link'><a href="BasicData.html#parse-class_method" title="Trello::BasicData.parse (method)">parse</a></span>, <span class='object_link'><a href="BasicData.html#parse_many-class_method" title="Trello::BasicData.parse_many (method)">parse_many</a></span>, <span class='object_link'><a href="BasicData.html#path_name-class_method" title="Trello::BasicData.path_name (method)">path_name</a></span>, <span class='object_link'><a href="BasicData.html#refresh!-instance_method" title="Trello::BasicData#refresh! (method)">#refresh!</a></span>, <span class='object_link'><a href="BasicData.html#register_attrs-class_method" title="Trello::BasicData.register_attrs (method)">register_attrs</a></span>, <span class='object_link'><a href="BasicData.html#save-class_method" title="Trello::BasicData.save (method)">save</a></span>, <span class='object_link'><a href="BasicData.html#save-instance_method" title="Trello::BasicData#save (method)">#save</a></span>, <span class='object_link'><a href="BasicData.html#schema-class_method" title="Trello::BasicData.schema (method)">schema</a></span>, <span class='object_link'><a href="BasicData.html#schema-instance_method" title="Trello::BasicData#schema (method)">#schema</a></span>, <span class='object_link'><a href="BasicData.html#update!-instance_method" title="Trello::BasicData#update! (method)">#update!</a></span>, <span class='object_link'><a href="BasicData.html#update_fields-instance_method" title="Trello::BasicData#update_fields (method)">#update_fields</a></span></p>
<h3 class="inherited">Methods included from <span class='object_link'><a href="JsonUtils.html" title="Trello::JsonUtils (module)">JsonUtils</a></span></h3>
<p class="inherited"><span class='object_link'><a href="JsonUtils.html#included-class_method" title="Trello::JsonUtils.included (method)">included</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="BasicData.html#initialize-instance_method" title="Trello::BasicData#initialize (method)">Trello::BasicData</a></span></p>
</div>
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
<span id=""></span>
<div class="method_details first">
<h3 class="signature first" id="badges-instance_method">
#<strong>badges</strong> ⇒ <tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span></tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="board_id=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="board_id-instance_method">
#<strong>board_id</strong> ⇒ <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns A 24-character hex string.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
—
<div class='inline'>
<p>A 24-character hex string</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="card_labels=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="card_labels-instance_method">
#<strong>card_labels</strong> ⇒ <tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span><<span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span>></tt>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span><<span class='object_link'><a href="../Hash.html" title="Hash (class)">Hash</a></span>></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="card_members-instance_method">
#<strong>card_members</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Object</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="closed=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="closed-instance_method">
#<strong>closed</strong> ⇒ <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="cover_image_id=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="cover_image_id-instance_method">
#<strong>cover_image_id</strong> ⇒ <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns A 24-character hex string.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
—
<div class='inline'>
<p>A 24-character hex string</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="desc=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="desc-instance_method">
#<strong>desc</strong> ⇒ <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="due=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="due-instance_method">
#<strong>due</strong> ⇒ <tt>Datetime</tt>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Datetime</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="id-instance_method">
#<strong>id</strong> ⇒ <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="labels=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="labels-instance_method">
#<strong>labels</strong> ⇒ <tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span><Trello::Labels></tt>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span><Trello::Labels></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="last_activity_date-instance_method">
#<strong>last_activity_date</strong> ⇒ <tt>Dateime</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Dateime</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="list_id=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="list_id-instance_method">
#<strong>list_id</strong> ⇒ <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns A 24-character hex string.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
—
<div class='inline'>
<p>A 24-character hex string</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="member_ids=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="member_ids-instance_method">
#<strong>member_ids</strong> ⇒ <tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span><<span class='object_link'><a href="../String.html" title="String (class)">String</a></span>></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns An Array of 24-character hex strings.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span><<span class='object_link'><a href="../String.html" title="String (class)">String</a></span>></tt>)</span>
—
<div class='inline'>
<p>An Array of 24-character hex strings</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="name=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="name-instance_method">
#<strong>name</strong> ⇒ <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="pos=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="pos-instance_method">
#<strong>pos</strong> ⇒ <tt>Float</tt>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Float</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="short_id-instance_method">
#<strong>short_id</strong> ⇒ <tt>Fixnum</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Fixnum</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="short_url-instance_method">
#<strong>short_url</strong> ⇒ <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="source_card_id=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="source_card_id-instance_method">
#<strong>source_card_id</strong> ⇒ <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns A 24-character hex string.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
—
<div class='inline'>
<p>A 24-character hex string</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id="source_card_properties=-instance_method"></span>
<div class="method_details ">
<h3 class="signature " id="source_card_properties-instance_method">
#<strong>source_card_properties</strong> ⇒ <tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span><<span class='object_link'><a href="../String.html" title="String (class)">String</a></span>></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns Array of strings.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span><<span class='object_link'><a href="../String.html" title="String (class)">String</a></span>></tt>)</span>
—
<div class='inline'>
<p>Array of strings</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="url-instance_method">
#<strong>url</strong> ⇒ <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 45</span>
<span class='kw'>class</span> <span class='const'><span class='object_link'><a href="" title="Trello::Card (class)">Card</a></span></span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="BasicData.html" title="Trello::BasicData (class)">BasicData</a></span></span>
<span class='id identifier rubyid_schema'>schema</span> <span class='kw'>do</span>
<span class='comment'># readonly
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>primary_key:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_id</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idShort</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:short_url</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>shortUrl</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:last_activity_date</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dateLastActivity</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:labels</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Labels</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:badges</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_members</span><span class='comma'>,</span> <span class='label'>readonly:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>members</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:name</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:desc</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Time</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:due_complete</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dueComplete</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:member_ids</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idMembers</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:list_id</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idList</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:pos</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:card_labels</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idLabels</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for create only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_id</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idCardSource</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:keep_from_source</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='comment'># Writable but for update only
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:closed</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:board_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idBoard</span><span class='tstring_end'>'</span></span>
<span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:cover_image_id</span><span class='comma'>,</span> <span class='label'>update_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>idAttachmentCover</span><span class='tstring_end'>'</span></span>
<span class='comment'># Deprecated
</span> <span class='id identifier rubyid_attribute'>attribute</span> <span class='symbol'>:source_card_properties</span><span class='comma'>,</span> <span class='label'>create_only:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='label'>remote_key:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>keepFromSource</span><span class='tstring_end'>'</span></span>
<span class='kw'>end</span>
<span class='id identifier rubyid_validates_presence_of'>validates_presence_of</span> <span class='symbol'>:id</span><span class='comma'>,</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='symbol'>:list_id</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:name</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>1</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_validates_length_of'>validates_length_of</span> <span class='symbol'>:desc</span><span class='comma'>,</span> <span class='label'>in:</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>16384</span>
<span class='id identifier rubyid_include'>include</span> <span class='const'><span class='object_link'><a href="HasActions.html" title="Trello::HasActions (module)">HasActions</a></span></span>
<span class='comment'># Returns a reference to the board this card is part of.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:board</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:boards</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:board_id</span>
<span class='comment'># Returns a reference to the cover image attachment
</span> <span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of checklists associated with the card.
</span> <span class='comment'>#
</span> <span class='comment'># The options hash may have a filter key which can have its value set as any
</span> <span class='comment'># of the following values:
</span> <span class='comment'># :filter => [ :none, :all ] # default :all
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:checklists</span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='symbol'>:all</span>
<span class='comment'># Returns a list of plugins associated with the card
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:plugin_data</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pluginData</span><span class='tstring_end'>"</span></span>
<span class='comment'># List of custom field values on the card, only the ones that have been set
</span> <span class='id identifier rubyid_many'>many</span> <span class='symbol'>:custom_field_items</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>customFieldItems</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a reference to the list this card is currently in.
</span> <span class='id identifier rubyid_one'>one</span> <span class='symbol'>:list</span><span class='comma'>,</span> <span class='label'>path:</span> <span class='symbol'>:lists</span><span class='comma'>,</span> <span class='label'>using:</span> <span class='symbol'>:list_id</span>
<span class='comment'># Returns a list of members who are assigned to this card.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Returns a list of members who have upvoted this card
</span> <span class='comment'># NOTE: this fetches a list each time it's called to avoid case where
</span> <span class='comment'># card is voted (or vote is removed) after card is fetched. Optimizing
</span> <span class='comment'># accuracy over network performance
</span> <span class='comment'>#
</span> <span class='comment'># @return [Array<Trello::Member>]
</span> <span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Delete this card
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] the JSON response from the Trello API
</span> <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Check if the card is not active anymore.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span>
<span class='comment'># Close the card.
</span> <span class='comment'>#
</span> <span class='comment'># This only marks your local copy card as closed. Use `close!` if you
</span> <span class='comment'># want to close the card and persist the change to the Trello API.
</span> <span class='comment'>#
</span> <span class='comment'># @return [Boolean] always returns true
</span> <span class='comment'>#
</span> <span class='comment'># @return [String] The JSON representation of the closed card returned by
</span> <span class='comment'># the Trello API.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span>
<span class='comment'># Is the record valid?
</span> <span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span>
<span class='comment'># Add a comment with the supplied text.
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add a checklist to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># create a new checklist and add it to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given list
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Moves this card to the given list no matter which board it is on
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Move this card to the given board (and optional list on this board)
</span> <span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Add a member to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a member from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Current authenticated user upvotes a card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Recind upvote. Noop if authenticated user hasn't previously voted
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span>
<span class='comment'># Add a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Remove a label
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Add an attachment to this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of attachments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span>
<span class='comment'># Remove an attachment from this card
</span> <span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># :nodoc:
</span> <span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='comment'># Retrieve a list of comments
</span> <span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='comment'># Find the creation date
</span> <span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_private'>private</span>
<span class='kw'>def</span> <span class='id identifier rubyid_me'>me</span>
<span class='ivar'>@me</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="Member.html#find-class_method" title="Trello::Member.find (method)">find</a></span></span><span class='lparen'>(</span><span class='symbol'>:me</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="add_attachment-instance_method">
#<strong>add_attachment</strong>(attachment, name = '') ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Add an attachment to this card</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
272
273
274
275
276
277
278
279
280
281
282
283
284
285</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 272</span>
<span class='kw'>def</span> <span class='id identifier rubyid_add_attachment'>add_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='comment'># Is it a file object or a string (url)?
</span> <span class='kw'>if</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:path</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:read</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>file:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>url:</span> <span class='id identifier rubyid_attachment'>attachment</span><span class='comma'>,</span>
<span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="add_checklist-instance_method">
#<strong>add_checklist</strong>(checklist, name: nil, position: nil) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Add a checklist to this card</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
175
176
177
178
179
180
181</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 175</span>
<span class='kw'>def</span> <span class='id identifier rubyid_add_checklist'>add_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_checklist'>checklist</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>position:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>idChecklistSource:</span> <span class='id identifier rubyid_checklist'>checklist</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span> <span class='kw'>if</span> <span class='id identifier rubyid_name'>name</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:pos</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_position'>position</span> <span class='kw'>if</span> <span class='id identifier rubyid_position'>position</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="add_comment-instance_method">
#<strong>add_comment</strong>(text) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Add a comment with the supplied text.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
170
171
172</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 170</span>
<span class='kw'>def</span> <span class='id identifier rubyid_add_comment'>add_comment</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions/comments</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>text:</span> <span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="add_label-instance_method">
#<strong>add_label</strong>(label) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Add a label</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
254
255
256
257
258
259
260</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 254</span>
<span class='kw'>def</span> <span class='id identifier rubyid_add_label'>add_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='label'>value:</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="add_member-instance_method">
#<strong>add_member</strong>(member) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Add a member to this card</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
218
219
220
221
222</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 218</span>
<span class='kw'>def</span> <span class='id identifier rubyid_add_member'>add_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="attachments-instance_method">
#<strong>attachments</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Retrieve a list of attachments</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
288
289
290
291</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 288</span>
<span class='kw'>def</span> <span class='id identifier rubyid_attachments'>attachments</span>
<span class='id identifier rubyid_attachments'>attachments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Attachment.html" title="Trello::Attachment (class)">Attachment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_attachments'>attachments</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="check_item_states-instance_method">
#<strong>check_item_states</strong> ⇒ <tt>Object</tt>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
108
109
110
111</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 108</span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_item_states'>check_item_states</span>
<span class='id identifier rubyid_states'>states</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="CheckItemState.html" title="Trello::CheckItemState (class)">CheckItemState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checkItemStates</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_states'>states</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="close-instance_method">
#<strong>close</strong> ⇒ <tt>Boolean</tt>, <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Close the card.</p>
<p>This only marks your local copy card as closed. Use `close!` if you want to close the card and persist the change to the Trello API.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
—
<div class='inline'>
<p>always returns true</p>
</div>
</li>
<li>
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
—
<div class='inline'>
<p>The JSON representation of the closed card returned by the Trello API.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
155
156
157</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 155</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span>
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_closed'>closed</span> <span class='op'>=</span> <span class='kw'>true</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="close!-instance_method">
#<strong>close!</strong> ⇒ <tt>Object</tt>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
159
160
161
162</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 159</span>
<span class='kw'>def</span> <span class='id identifier rubyid_close!'>close!</span>
<span class='id identifier rubyid_close'>close</span>
<span class='id identifier rubyid_save'>save</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="closed?-instance_method">
#<strong>closed?</strong> ⇒ <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Check if the card is not active anymore.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
142
143
144</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 142</span>
<span class='kw'>def</span> <span class='id identifier rubyid_closed?'>closed?</span>
<span class='id identifier rubyid_closed'>closed</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="comments-instance_method">
#<strong>comments</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Retrieve a list of comments</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
304
305
306</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 304</span>
<span class='kw'>def</span> <span class='id identifier rubyid_comments'>comments</span>
<span class='id identifier rubyid_comments'>comments</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Comment.html" title="Trello::Comment (class)">Comment</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/actions</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>filter:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>commentCard</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="cover_image-instance_method">
#<strong>cover_image</strong>(params = {}) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a reference to the cover image attachment</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
90
91
92
93</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 90</span>
<span class='kw'>def</span> <span class='id identifier rubyid_cover_image'>cover_image</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_cover_image_id'>cover_image_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="CoverImage.html" title="Trello::CoverImage (class)">CoverImage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="create_new_checklist-instance_method">
#<strong>create_new_checklist</strong>(name) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>create a new checklist and add it to this card</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
184
185
186</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 184</span>
<span class='kw'>def</span> <span class='id identifier rubyid_create_new_checklist'>create_new_checklist</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/checklists</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span> <span class='label'>name:</span> <span class='id identifier rubyid_name'>name</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="created_at-instance_method">
#<strong>created_at</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Find the creation date</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
309
310
311</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 309</span>
<span class='kw'>def</span> <span class='id identifier rubyid_created_at'>created_at</span>
<span class='ivar'>@created_at</span> <span class='op'>||=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='int'>7</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>rescue</span> <span class='kw'>nil</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="delete-instance_method">
#<strong>delete</strong> ⇒ <tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Delete this card</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></tt>)</span>
—
<div class='inline'>
<p>the JSON response from the Trello API</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
137
138
139</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 137</span>
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="members-instance_method">
#<strong>members</strong> ⇒ <tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span><<span class='object_link'><a href="Member.html" title="Trello::Member (class)">Trello::Member</a></span>></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a list of members who are assigned to this card.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span><<span class='object_link'><a href="Member.html" title="Trello::Member (class)">Trello::Member</a></span>></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
119
120
121
122</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 119</span>
<span class='kw'>def</span> <span class='id identifier rubyid_members'>members</span>
<span class='id identifier rubyid_members'>members</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/members</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='const'><span class='object_link'><a href="MultiAssociation.html" title="Trello::MultiAssociation (class)">MultiAssociation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MultiAssociation.html#initialize-instance_method" title="Trello::MultiAssociation#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_members'>members</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_proxy'><span class='object_link'><a href="Association.html#proxy-instance_method" title="Trello::Association#proxy (method)">proxy</a></span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="move_to_board-instance_method">
#<strong>move_to_board</strong>(new_board, new_list = nil) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Move this card to the given board (and optional list on this board)</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
209
210
211
212
213
214
215</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 209</span>
<span class='kw'>def</span> <span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='id identifier rubyid_new_board'>new_board</span><span class='comma'>,</span> <span class='id identifier rubyid_new_list'>new_list</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_board_id'>board_id</span> <span class='op'>==</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>value:</span> <span class='id identifier rubyid_new_board'>new_board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='rbrace'>}</span>
<span class='id identifier rubyid_payload'>payload</span><span class='lbracket'>[</span><span class='symbol'>:idList</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_list'>new_list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_list'>new_list</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idBoard</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="move_to_list-instance_method">
#<strong>move_to_list</strong>(list) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Move this card to the given list</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
189
190
191
192
193
194
195
196</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 189</span>
<span class='kw'>def</span> <span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list_number'>list_number</span> <span class='op'>=</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../String.html" title="String (class)">String</a></span></span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_list'>list</span> <span class='op'>:</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_list_id'>list_id</span> <span class='op'>==</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idList</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_list_number'>list_number</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="move_to_list_on_any_board-instance_method">
#<strong>move_to_list_on_any_board</strong>(list_id) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Moves this card to the given list no matter which board it is on</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
199
200
201
202
203
204
205
206</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 199</span>
<span class='kw'>def</span> <span class='id identifier rubyid_move_to_list_on_any_board'>move_to_list_on_any_board</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_list'>list</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="List.html" title="Trello::List (class)">List</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="List.html#find-class_method" title="Trello::List.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='id identifier rubyid_board'>board</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='op'>==</span> <span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span>
<span class='id identifier rubyid_move_to_list'>move_to_list</span><span class='lparen'>(</span><span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_move_to_board'>move_to_board</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Board.html" title="Trello::Board (class)">Board</a></span></span><span class='period'>.</span><span class='id identifier rubyid_find'><span class='object_link'><a href="BasicData.html#find-class_method" title="Trello::BasicData.find (method)">find</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_list'>list</span><span class='period'>.</span><span class='id identifier rubyid_board_id'>board_id</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_list'>list</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="remove_attachment-instance_method">
#<strong>remove_attachment</strong>(attachment) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Remove an attachment from this card</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
294
295
296</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 294</span>
<span class='kw'>def</span> <span class='id identifier rubyid_remove_attachment'>remove_attachment</span><span class='lparen'>(</span><span class='id identifier rubyid_attachment'>attachment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/attachments/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attachment'>attachment</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="remove_label-instance_method">
#<strong>remove_label</strong>(label) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Remove a label</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
263
264
265
266
267
268
269</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 263</span>
<span class='kw'>def</span> <span class='id identifier rubyid_remove_label'>remove_label</span><span class='lparen'>(</span><span class='id identifier rubyid_label'>label</span><span class='rparen'>)</span>
<span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='id identifier rubyid_errors'>errors</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>is not valid.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='period'>.</span><span class='id identifier rubyid_logger'><span class='object_link'><a href="../Trello.html#logger-class_method" title="Trello.logger (method)">logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Label is not valid.</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idLabels/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_label'>label</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="remove_member-instance_method">
#<strong>remove_member</strong>(member) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Remove a member from this card</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
225
226
227</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 225</span>
<span class='kw'>def</span> <span class='id identifier rubyid_remove_member'>remove_member</span><span class='lparen'>(</span><span class='id identifier rubyid_member'>member</span><span class='rparen'>)</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/idMembers/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_member'>member</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="remove_upvote-instance_method">
#<strong>remove_upvote</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Recind upvote. Noop if authenticated user hasn't previously voted</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
243
244
245
246
247
248
249
250
251</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 243</span>
<span class='kw'>def</span> <span class='id identifier rubyid_remove_upvote'>remove_upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has not voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="request_prefix-instance_method">
#<strong>request_prefix</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>:nodoc:</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
299
300
301</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 299</span>
<span class='kw'>def</span> <span class='id identifier rubyid_request_prefix'>request_prefix</span>
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="upvote-instance_method">
#<strong>upvote</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Current authenticated user upvotes a card</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
230
231
232
233
234
235
236
237
238
239
240</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 230</span>
<span class='kw'>def</span> <span class='id identifier rubyid_upvote'>upvote</span>
<span class='kw'>begin</span>
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
<span class='label'>value:</span> <span class='id identifier rubyid_me'>me</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
<span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../Trello.html" title="Trello (module)">Trello</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Error.html" title="Trello::Error (class)">Error</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
<span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_e'>e</span> <span class='kw'>unless</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=~</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>has already voted</span><span class='regexp_end'>/i</span></span>
<span class='kw'>end</span>
<span class='kw'>self</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="valid?-instance_method">
#<strong>valid?</strong> ⇒ <tt>Boolean</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Is the record valid?</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>Boolean</tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
165
166
167</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 165</span>
<span class='kw'>def</span> <span class='id identifier rubyid_valid?'>valid?</span>
<span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span> <span class='op'>&&</span> <span class='id identifier rubyid_list_id'>list_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="voters-instance_method">
#<strong>voters</strong> ⇒ <tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span><<span class='object_link'><a href="Member.html" title="Trello::Member (class)">Trello::Member</a></span>></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a list of members who have upvoted this card NOTE: this fetches a list each time it's called to avoid case where card is voted (or vote is removed) after card is fetched. Optimizing accuracy over network performance</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="../Array.html" title="Array (class)">Array</a></span><<span class='object_link'><a href="Member.html" title="Trello::Member (class)">Trello::Member</a></span>></tt>)</span>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
130
131
132</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/trello/card.rb', line 130</span>
<span class='kw'>def</span> <span class='id identifier rubyid_voters'>voters</span>
<span class='const'><span class='object_link'><a href="Member.html" title="Trello::Member (class)">Member</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from_response'>from_response</span> <span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>/cards/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_id'>id</span><span class='embexpr_end'>}</span><span class='tstring_content'>/membersVoted</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Tue Nov 10 16:31:49 2020 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.25 (ruby-2.6.6).
</div>
</div>
</body>
</html>