Class: Troo::Remote::Card

Inherits:
Object
  • Object
show all
Includes:
Troo::RemoteModelHelpers
Defined in:
lib/troo/remote/card.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Troo::RemoteModelHelpers

included

Class Method Details

.by_board_idHash

Returns:

  • (Hash)


36
37
38
39
40
41
# File 'lib/troo/remote/card.rb', line 36

def by_board_id
  {
    endpoint: :cards_by_board_id,
    query:    { filter: :open }
  }
end

.by_card_idHash

Returns:

  • (Hash)


52
53
54
55
56
57
# File 'lib/troo/remote/card.rb', line 52

def by_card_id
  {
    endpoint: :card_by_id,
    query:    { actions: :commentCard }
  }
end

.by_list_idHash

Returns:

  • (Hash)


44
45
46
47
48
49
# File 'lib/troo/remote/card.rb', line 44

def by_list_id
  {
    endpoint: :cards_by_list_id,
    query:    { filter: :open }
  }
end

.remote_optionsHash

Returns:

  • (Hash)


31
32
33
# File 'lib/troo/remote/card.rb', line 31

def remote_options
  { mode: :card }
end

Instance Method Details

#adaptedHash

Returns:

  • (Hash)


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/troo/remote/card.rb', line 71

def adapted
  {
    short_id:            idShort,
    name:                name,
    desc:                desc,
    url:                 url,
    position:            pos,
    last_activity_date:  dateLastActivity,
    closed:              closed,
    external_board_id:   idBoard,
    external_list_id:    idList,
    external_id:         id,
    external_member_ids: idMembers
  }
end

#associationsArray

Returns:

  • (Array)


61
62
63
# File 'lib/troo/remote/card.rb', line 61

def associations
  [:actions]
end

#local_modelObject

Returns [].

Returns:



66
67
68
# File 'lib/troo/remote/card.rb', line 66

def local_model
  Troo::Card
end