class Trello::Comment

A Comment is a string with a creation date; it resides inside a Card and belongs to a User.

@!attribute [r] action_id

@return [String]

@!attribute [r] text

@return [String]

@!attribute [r] date

@return [Datetime]

@!attribute [r] member_creator_id

@return [String]

Public Class Methods

find(action_id) click to toggle source

Locate a specific action and return a new Comment object.

# File lib/trello/comment.rb, line 20
def find(action_id)
  client.find(:action, action_id, filter: commentCard)
end

Public Instance Methods

board() click to toggle source

Returns the board this comment is located

# File lib/trello/comment.rb, line 38
def board
  Board.from_response client.get("/actions/#{action_id}/board")
end
card() click to toggle source

Returns the card the comment is located

# File lib/trello/comment.rb, line 43
def card
  Card.from_response client.get("/actions/#{action_id}/card")
end
delete() click to toggle source

Deletes the comment from the card

# File lib/trello/comment.rb, line 53
def delete
  ruta = "/actions/#{action_id}"
  client.delete(ruta)
end
list() click to toggle source

Returns the list the comment is located

# File lib/trello/comment.rb, line 48
def list
  List.from_response client.get("/actions/#{action_id}/list")
end
update_fields(fields) click to toggle source

Update the attributes of a Comment

Supply a hash of string keyed data retrieved from the Trello API representing a Comment.

# File lib/trello/comment.rb, line 29
def update_fields(fields)
  attributes[:action_id]          = fields['id'] || attributes[:action_id]
  attributes[:text]               = fields['data']['text'] || attributes[:text]
  attributes[:date]               = Time.iso8601(fields['date']) if fields.has_key?('date')
  attributes[:member_creator_id]  = fields['idMemberCreator'] || attributes[:member_creator_id]
  self
end