Module: Tacokit::Client::Actions

Included in:
Tacokit::Client
Defined in:
lib/tacokit/client/actions.rb

Instance Method Summary collapse

Instance Method Details

#action(action_id, options = nil) ⇒ Tacokit::Resource

Retrieve an action

Parameters:

  • action_id (String)

    the action identifier

Returns:

See Also:


8
9
10
# 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") ⇒ Tacokit::Resource

Retrieve an action's board

Parameters:

  • action_id (String)

    the action identifier

  • fields (String, Array<String>) (defaults to: "all")

    a list of board attributes to fetch

Returns:

See Also:


17
18
19
# 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") ⇒ Tacokit::Resource

Retrieve an actions“ card

Parameters:

  • action_id (String)

    the action identifier

  • fields (String, Array<String>) (defaults to: "all")

    a list of card attributes to fetch

Returns:

See Also:


26
27
28
# 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) ⇒ Array

Retrive an action's entities

Parameters:

  • action_id (String)

    the action identifier

Returns:

  • (Array)

    list of entity attributes involved in the action

See Also:


34
35
36
# 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") ⇒ Tacokit::Resource

Retrieve an action's list

Parameters:

  • action_id (String)

    the action identifier

  • fields (String, Array<String>) (defaults to: "all")

    a list of list attributes to fetch

Returns:

See Also:


43
44
45
# 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") ⇒ Tacokit::Resource

Retrieve an action's member

Parameters:

  • action_id (String)

    the action identifier

  • fields (String, Array<String>) (defaults to: "all")

    a list of member attributes to fetch

Returns:

See Also:


52
53
54
# 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") ⇒ Tacokit::Resource

Retrieve an action's creator

Parameters:

  • action_id (String)

    the action identifier

  • fields (String, Array<String>) (defaults to: "all")

    a list of member attributes to fetch

Returns:

See Also:


61
62
63
# 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") ⇒ Tacokit::Resource

Retrieve an action's organization

Parameters:

  • action_id (String)

    the action identifier

  • fields (String, Array<String>) (defaults to: "all")

    a list of organization attributes to fetch

Returns:

See Also:


70
71
72
# 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) ⇒ Object

Delete an action

Parameters:

  • action_id (String)

    the action identifier

See Also:


94
95
96
# File 'lib/tacokit/client/actions.rb', line 94

def delete_action(action_id)
  delete action_path(action_id)
end

#update_action(action_id, options = {}) ⇒ Object

Update an action

Parameters:

  • action_id (String)

    the action identifier

  • options (Hash) (defaults to: {})

    a hash of attributes to update

See Also:


78
79
80
# 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) ⇒ Object Also known as: edit_action_text

Set new text for an action

Parameters:

  • action_id (String)

    the action identifier

  • text (String)

    the new text

See Also:


86
87
88
# File 'lib/tacokit/client/actions.rb', line 86

def update_action_text(action_id, text)
  put action_path(action_id, "text"), value: text
end