class Trello::Action

Action represents some event that occurred. For instance, when a card is created.

@!attribute [r] id

@return [String]

@!attribute [r] type

@return [String]

@!attribute [r] data

@return [Hash]

@!attribute [r] date

@return [Datetime]

@!attribute [r] member_creator_id

@return [String]

@!attribute [r] member_participant

@return [Object]

Public Class Methods

find(id, params = {}) click to toggle source

Locate a specific action and return a new Action object.

# File lib/trello/action.rb, line 23
def find(id, params = {})
  client.find(:action, id, params)
end

Public Instance Methods

board() click to toggle source

Returns the board this action occurred on.

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

Returns the card the action occurred on.

# File lib/trello/action.rb, line 56
def card
  Card.from_response client.get("/actions/#{id}/card")
end
list() click to toggle source

Returns the list the action occurred on.

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

Update the attributes of an action

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

# File lib/trello/action.rb, line 40
def update_fields(fields)
  attributes[:id]                 = fields['id']
  attributes[:type]               = fields['type']
  attributes[:data]               = fields['data']
  attributes[:date]               = Time.iso8601(fields['date'])
  attributes[:member_creator_id]  = fields['idMemberCreator']
  attributes[:member_participant] = fields['member']
  self
end