Class: Trello::Action

Inherits:
BasicData show all
Defined in:
lib/trello/action.rb

Overview

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

Instance Attribute Summary collapse

Attributes inherited from BasicData

#client

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BasicData

#==, #attributes, client, #collection_name, #collection_path, create, #element_name, #element_path, #hash, #initialize, many, one, parse, parse_many, path_name, #refresh!, register_attrs, #save, save, schema, #schema, #update!, #update_fields

Methods included from JsonUtils

included

Constructor Details

This class inherits a constructor from Trello::BasicData

Instance Attribute Details

#app_creatorString (readonly)

Returns:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/trello/action.rb', line 22

class Action < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :creator_id, readonly: true, remote_key: 'idMemberCreator'
    attribute :data, readonly: true
    attribute :type, readonly: true
    attribute :date, readonly: true, serializer: 'Time'
    attribute :limits, readonly: true
    attribute :app_creator, readonly: true, remote_key: 'appCreator'
    attribute :display, readonly: true

    # Writable
    attribute :text, update_only: true
  end

  validates_presence_of :id, :type, :date, :creator_id

  class << self
    # Locate a specific action and return a new Action object.
    def find(id, params = {})
      client.find(:action, id, params)
    end

    def search(query, opts = {})
      response = client.get("/search/", { query: query }.merge(opts))
      parse_json(response).except("options").each_with_object({}) do |(key, data), result|
        klass = "Trello::#{key.singularize.capitalize}".constantize
        result[key] = klass.from_json(data)
      end
    end
  end

  # Returns the board this action occurred on.
  def board(params = {})
    Board.from_response client.get("/actions/#{id}/board", params)
  end

  # Returns the card the action occurred on.
  def card(params = {})
    Card.from_response client.get("/actions/#{id}/card", params)
  end

  # Returns the list the action occurred on.
  def list(params = {})
    List.from_response client.get("/actions/#{id}/list", params)
  end

  # Returns the list the action occurred on.
  def member_creator(params = {})
    Member.from_response client.get("/actions/#{id}/memberCreator", params)
  end
end

#creator_idString (readonly)

Returns:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/trello/action.rb', line 22

class Action < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :creator_id, readonly: true, remote_key: 'idMemberCreator'
    attribute :data, readonly: true
    attribute :type, readonly: true
    attribute :date, readonly: true, serializer: 'Time'
    attribute :limits, readonly: true
    attribute :app_creator, readonly: true, remote_key: 'appCreator'
    attribute :display, readonly: true

    # Writable
    attribute :text, update_only: true
  end

  validates_presence_of :id, :type, :date, :creator_id

  class << self
    # Locate a specific action and return a new Action object.
    def find(id, params = {})
      client.find(:action, id, params)
    end

    def search(query, opts = {})
      response = client.get("/search/", { query: query }.merge(opts))
      parse_json(response).except("options").each_with_object({}) do |(key, data), result|
        klass = "Trello::#{key.singularize.capitalize}".constantize
        result[key] = klass.from_json(data)
      end
    end
  end

  # Returns the board this action occurred on.
  def board(params = {})
    Board.from_response client.get("/actions/#{id}/board", params)
  end

  # Returns the card the action occurred on.
  def card(params = {})
    Card.from_response client.get("/actions/#{id}/card", params)
  end

  # Returns the list the action occurred on.
  def list(params = {})
    List.from_response client.get("/actions/#{id}/list", params)
  end

  # Returns the list the action occurred on.
  def member_creator(params = {})
    Member.from_response client.get("/actions/#{id}/memberCreator", params)
  end
end

#dataHash (readonly)

Returns:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/trello/action.rb', line 22

class Action < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :creator_id, readonly: true, remote_key: 'idMemberCreator'
    attribute :data, readonly: true
    attribute :type, readonly: true
    attribute :date, readonly: true, serializer: 'Time'
    attribute :limits, readonly: true
    attribute :app_creator, readonly: true, remote_key: 'appCreator'
    attribute :display, readonly: true

    # Writable
    attribute :text, update_only: true
  end

  validates_presence_of :id, :type, :date, :creator_id

  class << self
    # Locate a specific action and return a new Action object.
    def find(id, params = {})
      client.find(:action, id, params)
    end

    def search(query, opts = {})
      response = client.get("/search/", { query: query }.merge(opts))
      parse_json(response).except("options").each_with_object({}) do |(key, data), result|
        klass = "Trello::#{key.singularize.capitalize}".constantize
        result[key] = klass.from_json(data)
      end
    end
  end

  # Returns the board this action occurred on.
  def board(params = {})
    Board.from_response client.get("/actions/#{id}/board", params)
  end

  # Returns the card the action occurred on.
  def card(params = {})
    Card.from_response client.get("/actions/#{id}/card", params)
  end

  # Returns the list the action occurred on.
  def list(params = {})
    List.from_response client.get("/actions/#{id}/list", params)
  end

  # Returns the list the action occurred on.
  def member_creator(params = {})
    Member.from_response client.get("/actions/#{id}/memberCreator", params)
  end
end

#dateDatetime (readonly)

Returns:

  • (Datetime)


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/trello/action.rb', line 22

class Action < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :creator_id, readonly: true, remote_key: 'idMemberCreator'
    attribute :data, readonly: true
    attribute :type, readonly: true
    attribute :date, readonly: true, serializer: 'Time'
    attribute :limits, readonly: true
    attribute :app_creator, readonly: true, remote_key: 'appCreator'
    attribute :display, readonly: true

    # Writable
    attribute :text, update_only: true
  end

  validates_presence_of :id, :type, :date, :creator_id

  class << self
    # Locate a specific action and return a new Action object.
    def find(id, params = {})
      client.find(:action, id, params)
    end

    def search(query, opts = {})
      response = client.get("/search/", { query: query }.merge(opts))
      parse_json(response).except("options").each_with_object({}) do |(key, data), result|
        klass = "Trello::#{key.singularize.capitalize}".constantize
        result[key] = klass.from_json(data)
      end
    end
  end

  # Returns the board this action occurred on.
  def board(params = {})
    Board.from_response client.get("/actions/#{id}/board", params)
  end

  # Returns the card the action occurred on.
  def card(params = {})
    Card.from_response client.get("/actions/#{id}/card", params)
  end

  # Returns the list the action occurred on.
  def list(params = {})
    List.from_response client.get("/actions/#{id}/list", params)
  end

  # Returns the list the action occurred on.
  def member_creator(params = {})
    Member.from_response client.get("/actions/#{id}/memberCreator", params)
  end
end

#displayHash (readonly)

Returns:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/trello/action.rb', line 22

class Action < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :creator_id, readonly: true, remote_key: 'idMemberCreator'
    attribute :data, readonly: true
    attribute :type, readonly: true
    attribute :date, readonly: true, serializer: 'Time'
    attribute :limits, readonly: true
    attribute :app_creator, readonly: true, remote_key: 'appCreator'
    attribute :display, readonly: true

    # Writable
    attribute :text, update_only: true
  end

  validates_presence_of :id, :type, :date, :creator_id

  class << self
    # Locate a specific action and return a new Action object.
    def find(id, params = {})
      client.find(:action, id, params)
    end

    def search(query, opts = {})
      response = client.get("/search/", { query: query }.merge(opts))
      parse_json(response).except("options").each_with_object({}) do |(key, data), result|
        klass = "Trello::#{key.singularize.capitalize}".constantize
        result[key] = klass.from_json(data)
      end
    end
  end

  # Returns the board this action occurred on.
  def board(params = {})
    Board.from_response client.get("/actions/#{id}/board", params)
  end

  # Returns the card the action occurred on.
  def card(params = {})
    Card.from_response client.get("/actions/#{id}/card", params)
  end

  # Returns the list the action occurred on.
  def list(params = {})
    List.from_response client.get("/actions/#{id}/list", params)
  end

  # Returns the list the action occurred on.
  def member_creator(params = {})
    Member.from_response client.get("/actions/#{id}/memberCreator", params)
  end
end

#idString (readonly)

Returns:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/trello/action.rb', line 22

class Action < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :creator_id, readonly: true, remote_key: 'idMemberCreator'
    attribute :data, readonly: true
    attribute :type, readonly: true
    attribute :date, readonly: true, serializer: 'Time'
    attribute :limits, readonly: true
    attribute :app_creator, readonly: true, remote_key: 'appCreator'
    attribute :display, readonly: true

    # Writable
    attribute :text, update_only: true
  end

  validates_presence_of :id, :type, :date, :creator_id

  class << self
    # Locate a specific action and return a new Action object.
    def find(id, params = {})
      client.find(:action, id, params)
    end

    def search(query, opts = {})
      response = client.get("/search/", { query: query }.merge(opts))
      parse_json(response).except("options").each_with_object({}) do |(key, data), result|
        klass = "Trello::#{key.singularize.capitalize}".constantize
        result[key] = klass.from_json(data)
      end
    end
  end

  # Returns the board this action occurred on.
  def board(params = {})
    Board.from_response client.get("/actions/#{id}/board", params)
  end

  # Returns the card the action occurred on.
  def card(params = {})
    Card.from_response client.get("/actions/#{id}/card", params)
  end

  # Returns the list the action occurred on.
  def list(params = {})
    List.from_response client.get("/actions/#{id}/list", params)
  end

  # Returns the list the action occurred on.
  def member_creator(params = {})
    Member.from_response client.get("/actions/#{id}/memberCreator", params)
  end
end

#limitsHash (readonly)

Returns:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/trello/action.rb', line 22

class Action < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :creator_id, readonly: true, remote_key: 'idMemberCreator'
    attribute :data, readonly: true
    attribute :type, readonly: true
    attribute :date, readonly: true, serializer: 'Time'
    attribute :limits, readonly: true
    attribute :app_creator, readonly: true, remote_key: 'appCreator'
    attribute :display, readonly: true

    # Writable
    attribute :text, update_only: true
  end

  validates_presence_of :id, :type, :date, :creator_id

  class << self
    # Locate a specific action and return a new Action object.
    def find(id, params = {})
      client.find(:action, id, params)
    end

    def search(query, opts = {})
      response = client.get("/search/", { query: query }.merge(opts))
      parse_json(response).except("options").each_with_object({}) do |(key, data), result|
        klass = "Trello::#{key.singularize.capitalize}".constantize
        result[key] = klass.from_json(data)
      end
    end
  end

  # Returns the board this action occurred on.
  def board(params = {})
    Board.from_response client.get("/actions/#{id}/board", params)
  end

  # Returns the card the action occurred on.
  def card(params = {})
    Card.from_response client.get("/actions/#{id}/card", params)
  end

  # Returns the list the action occurred on.
  def list(params = {})
    List.from_response client.get("/actions/#{id}/list", params)
  end

  # Returns the list the action occurred on.
  def member_creator(params = {})
    Member.from_response client.get("/actions/#{id}/memberCreator", params)
  end
end

#text=(value) ⇒ String (writeonly)

Returns:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/trello/action.rb', line 22

class Action < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :creator_id, readonly: true, remote_key: 'idMemberCreator'
    attribute :data, readonly: true
    attribute :type, readonly: true
    attribute :date, readonly: true, serializer: 'Time'
    attribute :limits, readonly: true
    attribute :app_creator, readonly: true, remote_key: 'appCreator'
    attribute :display, readonly: true

    # Writable
    attribute :text, update_only: true
  end

  validates_presence_of :id, :type, :date, :creator_id

  class << self
    # Locate a specific action and return a new Action object.
    def find(id, params = {})
      client.find(:action, id, params)
    end

    def search(query, opts = {})
      response = client.get("/search/", { query: query }.merge(opts))
      parse_json(response).except("options").each_with_object({}) do |(key, data), result|
        klass = "Trello::#{key.singularize.capitalize}".constantize
        result[key] = klass.from_json(data)
      end
    end
  end

  # Returns the board this action occurred on.
  def board(params = {})
    Board.from_response client.get("/actions/#{id}/board", params)
  end

  # Returns the card the action occurred on.
  def card(params = {})
    Card.from_response client.get("/actions/#{id}/card", params)
  end

  # Returns the list the action occurred on.
  def list(params = {})
    List.from_response client.get("/actions/#{id}/list", params)
  end

  # Returns the list the action occurred on.
  def member_creator(params = {})
    Member.from_response client.get("/actions/#{id}/memberCreator", params)
  end
end

#typeString (readonly)

Returns:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/trello/action.rb', line 22

class Action < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :creator_id, readonly: true, remote_key: 'idMemberCreator'
    attribute :data, readonly: true
    attribute :type, readonly: true
    attribute :date, readonly: true, serializer: 'Time'
    attribute :limits, readonly: true
    attribute :app_creator, readonly: true, remote_key: 'appCreator'
    attribute :display, readonly: true

    # Writable
    attribute :text, update_only: true
  end

  validates_presence_of :id, :type, :date, :creator_id

  class << self
    # Locate a specific action and return a new Action object.
    def find(id, params = {})
      client.find(:action, id, params)
    end

    def search(query, opts = {})
      response = client.get("/search/", { query: query }.merge(opts))
      parse_json(response).except("options").each_with_object({}) do |(key, data), result|
        klass = "Trello::#{key.singularize.capitalize}".constantize
        result[key] = klass.from_json(data)
      end
    end
  end

  # Returns the board this action occurred on.
  def board(params = {})
    Board.from_response client.get("/actions/#{id}/board", params)
  end

  # Returns the card the action occurred on.
  def card(params = {})
    Card.from_response client.get("/actions/#{id}/card", params)
  end

  # Returns the list the action occurred on.
  def list(params = {})
    List.from_response client.get("/actions/#{id}/list", params)
  end

  # Returns the list the action occurred on.
  def member_creator(params = {})
    Member.from_response client.get("/actions/#{id}/memberCreator", params)
  end
end

Class Method Details

.find(id, params = {}) ⇒ Object

Locate a specific action and return a new Action object.



43
44
45
# File 'lib/trello/action.rb', line 43

def find(id, params = {})
  client.find(:action, id, params)
end

.search(query, opts = {}) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/trello/action.rb', line 47

def search(query, opts = {})
  response = client.get("/search/", { query: query }.merge(opts))
  parse_json(response).except("options").each_with_object({}) do |(key, data), result|
    klass = "Trello::#{key.singularize.capitalize}".constantize
    result[key] = klass.from_json(data)
  end
end

Instance Method Details

#board(params = {}) ⇒ Object

Returns the board this action occurred on.



57
58
59
# File 'lib/trello/action.rb', line 57

def board(params = {})
  Board.from_response client.get("/actions/#{id}/board", params)
end

#card(params = {}) ⇒ Object

Returns the card the action occurred on.



62
63
64
# File 'lib/trello/action.rb', line 62

def card(params = {})
  Card.from_response client.get("/actions/#{id}/card", params)
end

#list(params = {}) ⇒ Object

Returns the list the action occurred on.



67
68
69
# File 'lib/trello/action.rb', line 67

def list(params = {})
  List.from_response client.get("/actions/#{id}/list", params)
end

#member_creator(params = {}) ⇒ Object

Returns the list the action occurred on.



72
73
74
# File 'lib/trello/action.rb', line 72

def member_creator(params = {})
  Member.from_response client.get("/actions/#{id}/memberCreator", params)
end