module Tacokit::Client::Actions

Public Instance Methods

action(action_id, options = nil) click to toggle source

Retrieve an action @param action_id [String] the action identifier @return [Tacokit::Resource] the action resource @see developers.trello.com/advanced-reference/action#get-1-actions-idaction

# File lib/tacokit/client/actions.rb, line 8
def action(action_id, options = nil)
  get action_path(action_id), options
end
action_board(action_id, fields = "all") click to toggle source

Retrieve an action's board @param action_id [String] the action identifier @param fields [String, Array<String>] a list of board attributes to fetch @return [Tacokit::Resource] the board resource @see developers.trello.com/advanced-reference/action#get-1-actions-idaction-field

# File lib/tacokit/client/actions.rb, line 17
def action_board(action_id, fields = "all")
  action_resource action_id, "board", fields: fields
end
action_card(action_id, fields = "all") click to toggle source

Retrieve an actions“ card @param action_id [String] the action identifier @param fields [String, Array<String>] a list of card attributes to fetch @return [Tacokit::Resource] the card resource @see developers.trello.com/advanced-reference/action#get-1-actions-idaction-card

# File lib/tacokit/client/actions.rb, line 26
def action_card(action_id, fields = "all")
  action_resource action_id, "card", fields: fields
end
action_entities(action_id) click to toggle source

Retrive an action's entities @param action_id [String] the action identifier @return [Array] list of entity attributes involved in the action @see developers.trello.com/advanced-reference/action#get-1-actions-idaction-entities

# File lib/tacokit/client/actions.rb, line 34
def action_entities(action_id)
  action_resource action_id, "entities"
end
action_list(action_id, fields = "all") click to toggle source

Retrieve an action's list @param action_id [String] the action identifier @param fields [String, Array<String>] a list of list attributes to fetch @return [Tacokit::Resource] the list resource @see developers.trello.com/advanced-reference/action#get-1-actions-idaction-list

# File lib/tacokit/client/actions.rb, line 43
def action_list(action_id, fields = "all")
  action_resource action_id, "list", fields: fields
end
action_member(action_id, fields = "all") click to toggle source

Retrieve an action's member @param action_id [String] the action identifier @param fields [String, Array<String>] a list of member attributes to fetch @return [Tacokit::Resource] the member resource @see developers.trello.com/advanced-reference/action#get-1-actions-idaction-member

# File lib/tacokit/client/actions.rb, line 52
def action_member(action_id, fields = "all")
  action_resource action_id, "member", fields: fields
end
action_member_creator(action_id, fields = "all") click to toggle source

Retrieve an action's creator @param action_id [String] the action identifier @param fields [String, Array<String>] a list of member attributes to fetch @return [Tacokit::Resource] the member resource @see developers.trello.com/advanced-reference/action#get-1-actions-idaction-membercreator

# File lib/tacokit/client/actions.rb, line 61
def action_member_creator(action_id, fields = "all")
  action_resource action_id, "memberCreator", fields: fields
end
action_organization(action_id, fields = "all") click to toggle source

Retrieve an action's organization @param action_id [String] the action identifier @param fields [String, Array<String>] a list of organization attributes to fetch @return [Tacokit::Resource] the organization resource @see developers.trello.com/advanced-reference/action#get-1-actions-idaction-organization

# File lib/tacokit/client/actions.rb, line 70
def action_organization(action_id, fields = "all")
  action_resource action_id, "organization", fields: fields
end
delete_action(action_id) click to toggle source

Delete an action @param action_id [String] the action identifier @see developers.trello.com/advanced-reference/action#delete-1-actions-idaction

# File lib/tacokit/client/actions.rb, line 94
def delete_action(action_id)
  delete action_path(action_id)
end
edit_action_text(action_id, text)
Alias for: update_action_text
update_action(action_id, options = {}) click to toggle source

Update an action @param action_id [String] the action identifier @param options [Hash] a hash of attributes to update @see developers.trello.com/advanced-reference/action#put-1-actions-idaction

# File lib/tacokit/client/actions.rb, line 78
def update_action(action_id, options = {})
  put action_path(action_id), options
end
update_action_text(action_id, text) click to toggle source

Set new text for an action @param action_id [String] the action identifier @param text [String] the new text @see developers.trello.com/advanced-reference/action#put-1-actions-idaction-text

# File lib/tacokit/client/actions.rb, line 86
def update_action_text(action_id, text)
  put action_path(action_id, "text"), value: text
end
Also aliased as: edit_action_text

Private Instance Methods

action_path(action_id, *paths) click to toggle source
# File lib/tacokit/client/actions.rb, line 105
def action_path(action_id, *paths)
  resource_path("actions", action_id, *paths)
end
action_resource(action_id, resource, *paths) click to toggle source
# File lib/tacokit/client/actions.rb, line 100
def action_resource(action_id, resource, *paths)
  paths, options = extract_options(camp(resource), *paths)
  get action_path(action_id, *paths), options
end