Class: Trello::Board

Inherits:
BasicData show all
Includes:
HasActions
Defined in:
lib/trello/board.rb

Overview

A board on Trello

Instance Attribute Summary collapse

Attributes inherited from BasicData

#client

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HasActions

#actions

Methods inherited from BasicData

#==, #attributes, client, #collection_name, #collection_path, create, #element_name, #element_path, find, #hash, #initialize, many, one, parse, parse_many, path_name, #refresh!, register_attrs, #save, save, schema, #schema, #update!, #update_fields

Methods included from JsonUtils

included

Constructor Details

This class inherits a constructor from Trello::BasicData

Instance Attribute Details

#background_colorString

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#background_imageString

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#card_aging_typeString

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#closedBoolean

Returns:

  • (Boolean)


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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#comment_permission_levelString

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#descriptionString

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#description_dataDatetime (readonly)

Returns:

  • (Datetime)


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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#enable_card_coversBoolean

Returns:

  • (Boolean)


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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#enable_self_joinBoolean

Returns:

  • (Boolean)


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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#enterprise_idString (readonly)

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#idString (readonly)

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#invitation_permission_levelString

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#keep_cards_from_source=(value) ⇒ String (writeonly)

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#last_activity_dateDatetime (readonly)

Returns:

  • (Datetime)


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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#nameString

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#organization_idString

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#pinnedBoolean (readonly)

Returns:

  • (Boolean)


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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#power_ups=(value) ⇒ String (writeonly)

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#prefsHash (readonly)

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#short_urlString (readonly)

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#source_board_id=(value) ⇒ String (writeonly)

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#starredBoolean (readonly)

Returns:

  • (Boolean)


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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#subscribed=(value) ⇒ Boolean (writeonly)

Returns:

  • (Boolean)


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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#urlString (readonly)

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#use_default_labels=(value) ⇒ Boolean (writeonly)

Returns:

  • (Boolean)


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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#use_default_lists=(value) ⇒ Boolean (writeonly)

Returns:

  • (Boolean)


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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#visibility_levelString

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

#voting_permission_levelString

Returns:



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
# File 'lib/trello/board.rb', line 61

class Board < BasicData
  schema do
    attribute :id, readonly: true, primary_key: true

    # Readonly
    attribute :starred, readonly: true
    attribute :pinned, readonly: true
    attribute :url, readonly: true
    attribute :short_url, readonly: true, remote_key: 'shortUrl'
    attribute :prefs, readonly: true, default: {}
    attribute :last_activity_date, readonly: true, remote_key: 'dateLastActivity', serializer: 'Time'
    attribute :description_data, readonly: true, remote_key: 'descData'
    attribute :enterprise_id, readonly: true, remote_key: 'idEnterprise'

    # Writable
    attribute :name
    attribute :description, remote_key: 'desc'
    attribute :organization_id, remote_key: 'idOrganization'
    attribute :visibility_level, remote_key: 'permissionLevel', class_name: 'BoardPref'
    attribute :voting_permission_level, remote_key: 'voting', class_name: 'BoardPref'
    attribute :comment_permission_level, remote_key: 'comments', class_name: 'BoardPref'
    attribute :invitation_permission_level, remote_key: 'invitations', class_name: 'BoardPref'
    attribute :enable_self_join, remote_key: 'selfJoin', class_name: 'BoardPref'
    attribute :enable_card_covers, remote_key: 'cardCovers', class_name: 'BoardPref'
    attribute :background_color, remote_key: 'background', class_name: 'BoardPref'
    attribute :background_image, remote_key: 'backgroundImage', class_name: 'BoardPref'
    attribute :card_aging_type, remote_key: 'cardAging', class_name: 'BoardPref'

    # Writable but for create only
    attribute :use_default_labels, create_only: true, remote_key: 'defaultLabels'
    attribute :use_default_lists, create_only: true, remote_key: 'defaultLists'
    attribute :source_board_id, create_only: true, remote_key: 'idBoardSource'
    attribute :keep_cards_from_source, create_only: true, remote_key: 'keepFromSource'
    attribute :power_ups, create_only: true, remote_key: 'powerUps'

    # Writable but for update only
    attribute :closed, update_only: true
    attribute :subscribed, update_only: true
  end

  validates_presence_of :id, :name
  validates_length_of   :name,        in: 1..16384
  validates_length_of   :description, maximum: 16384

  include HasActions

  class << self
    # @return [Array<Trello::Board>] all boards for the current user
    def all(params = {})
      from_response client.get("/members/#{Member.find(:me).username}/boards", params)
    end
  end

  # @return [Boolean]
  def closed?
    attributes[:closed]
  end

  # @return [Boolean]
  def starred?
    attributes[:starred]
  end

  # @return [Boolean]
  def has_lists?
    lists.size > 0
  end

  # Find a card on this Board with the given ID.
  # @return [Trello::Card]
  def find_card(card_id)
    Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
  end

  # Add a member to this Board.
  #    type => [ :admin, :normal, :observer ]
  def add_member(member, type = :normal)
    client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
  end

  # Remove a member of this Board.
  def remove_member(member)
    client.delete("/boards/#{self.id}/members/#{member.id}")
  end

  # Return all the cards on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :cards, filter: :open

  # Returns all the lists on this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :open, :closed, :all ] # default :open
  many :lists, filter: :open

  # Returns an array of members who are associated with this board.
  #
  # This method, when called, can take a hash table with a filter key containing any
  # of the following values:
  #    :filter => [ :none, :normal, :owners, :admins, :all ] # default :all
  many :members, filter: :all

  # Returns a list of checklists associated with the board.
  #
  # The options hash may have a filter key which can have its value set as any
  # of the following values:
  #    :filter => [ :none, :all ] # default :all
  many :checklists, filter: :all

  # Returns a reference to the organization this board belongs to.
  one :organization, path: :organizations, using: :organization_id

  # Returns a list of plugins associated with the board
  many :plugin_data, path: "pluginData"

  # Returns custom fields activated on this board
  many :custom_fields, path: "customFields"

  def labels(params = {})
    # Set the limit to as high as possible given there is no pagination in this API.
    params[:limit] = 1000 unless params[:limit]
    labels = Label.from_response client.get("/boards/#{id}/labels", params)
    MultiAssociation.new(self, labels).proxy
  end

  def label_names
    label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
    MultiAssociation.new(self, label_names).proxy
  end

  # :nodoc:
  def request_prefix
    "/boards/#{id}"
  end

end

Class Method Details

.all(params = {}) ⇒ Array<Trello::Board>

Returns all boards for the current user.

Returns:



109
110
111
# File 'lib/trello/board.rb', line 109

def all(params = {})
  from_response client.get("/members/#{Member.find(:me).username}/boards", params)
end

Instance Method Details

#add_member(member, type = :normal) ⇒ Object

Add a member to this Board.

type => [ :admin, :normal, :observer ]


137
138
139
# File 'lib/trello/board.rb', line 137

def add_member(member, type = :normal)
  client.put("/boards/#{self.id}/members/#{member.id}", { type: type })
end

#closed?Boolean

Returns:

  • (Boolean)


115
116
117
# File 'lib/trello/board.rb', line 115

def closed?
  attributes[:closed]
end

#find_card(card_id) ⇒ Trello::Card

Find a card on this Board with the given ID.

Returns:



131
132
133
# File 'lib/trello/board.rb', line 131

def find_card(card_id)
  Card.from_response client.get("/boards/#{self.id}/cards/#{card_id}")
end

#has_lists?Boolean

Returns:

  • (Boolean)


125
126
127
# File 'lib/trello/board.rb', line 125

def has_lists?
  lists.size > 0
end

#label_namesObject



190
191
192
193
# File 'lib/trello/board.rb', line 190

def label_names
  label_names = LabelName.from_response client.get("/boards/#{id}/labelnames")
  MultiAssociation.new(self, label_names).proxy
end

#labels(params = {}) ⇒ Object



183
184
185
186
187
188
# File 'lib/trello/board.rb', line 183

def labels(params = {})
  # Set the limit to as high as possible given there is no pagination in this API.
  params[:limit] = 1000 unless params[:limit]
  labels = Label.from_response client.get("/boards/#{id}/labels", params)
  MultiAssociation.new(self, labels).proxy
end

#remove_member(member) ⇒ Object

Remove a member of this Board.



142
143
144
# File 'lib/trello/board.rb', line 142

def remove_member(member)
  client.delete("/boards/#{self.id}/members/#{member.id}")
end

#request_prefixObject

:nodoc:



196
197
198
# File 'lib/trello/board.rb', line 196

def request_prefix
  "/boards/#{id}"
end

#starred?Boolean

Returns:

  • (Boolean)


120
121
122
# File 'lib/trello/board.rb', line 120

def starred?
  attributes[:starred]
end