Class: Trello::Action
Overview
Action represents some event that occurred. For instance, when a card is created.
Class Method Summary collapse
-
.find(id) ⇒ Object
Locate a specific action and return a new Action object.
Instance Method Summary collapse
-
#board ⇒ Object
Returns the board this action occurred on.
-
#card ⇒ Object
Returns the card the action occurred on.
-
#list ⇒ Object
Returns the list the action occurred on.
-
#update_fields(fields) ⇒ Object
Update the attributes of an action.
Methods inherited from BasicData
#==, #initialize, many, one, #refresh!, register_attributes
Constructor Details
This class inherits a constructor from Trello::BasicData
Class Method Details
.find(id) ⇒ Object
Locate a specific action and return a new Action object.
10 11 12 |
# File 'lib/trello/action.rb', line 10 def find(id) super(:actions, id) end |
Instance Method Details
#board ⇒ Object
Returns the board this action occurred on.
29 30 31 |
# File 'lib/trello/action.rb', line 29 def board Client.get("/actions/#{id}/board").json_into(Board) end |
#card ⇒ Object
Returns the card the action occurred on.
34 35 36 |
# File 'lib/trello/action.rb', line 34 def card Client.get("/actions/#{id}/card").json_into(Card) end |
#list ⇒ Object
Returns the list the action occurred on.
39 40 41 |
# File 'lib/trello/action.rb', line 39 def list Client.get("/actions/#{id}/list").json_into(List) end |
#update_fields(fields) ⇒ Object
Update the attributes of an action
Supply a hash of string keyed data retrieved from the Trello API representing an Action.
19 20 21 22 23 24 25 26 |
# File 'lib/trello/action.rb', line 19 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'] self end |