Class: Troo::Remote::Comment

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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Troo::RemoteModelHelpers

included

Class Method Details

.by_board_idHash

Returns:

  • (Hash)


21
22
23
24
25
26
# File 'lib/troo/remote/comment.rb', line 21

def by_board_id
  {
    endpoint: :comments_by_board_id,
    query:    { filter: :commentCard }
  }
end

.by_card_idHash

Returns:

  • (Hash)


29
30
31
32
33
34
# File 'lib/troo/remote/comment.rb', line 29

def by_card_id
  {
    endpoint: :comments_by_card_id,
    query:    { filter: :commentCard }
  }
end

.remote_optionsHash

Returns:

  • (Hash)


16
17
18
# File 'lib/troo/remote/comment.rb', line 16

def remote_options
  { mode: :card }
end

Instance Method Details

#adaptedHash

Returns:

  • (Hash)


68
69
70
71
72
73
74
75
76
77
# File 'lib/troo/remote/comment.rb', line 68

def adapted
  {
    external_id:        id,
    external_board_id:  data.board.id,
    external_card_id:   data.card.id,
    external_member_id: idMemberCreator,
    date:               date,
    text:               text
  }
end

#associationsArray

Returns:

  • (Array)


58
59
60
# File 'lib/troo/remote/comment.rb', line 58

def associations
  [:memberCreator]
end

#external_board_idObject

Returns [].

Returns:



38
39
40
# File 'lib/troo/remote/comment.rb', line 38

def external_board_id
  data.board.id
end

#external_card_idObject

Returns [].

Returns:



43
44
45
# File 'lib/troo/remote/comment.rb', line 43

def external_card_id
  data.card.id
end

#external_comment_idObject

Returns [].

Returns:



48
49
50
# File 'lib/troo/remote/comment.rb', line 48

def external_comment_id
  id
end

#local_modelObject

Returns [].

Returns:



63
64
65
# File 'lib/troo/remote/comment.rb', line 63

def local_model
  Troo::Comment
end

#textObject

Returns [].

Returns:



53
54
55
# File 'lib/troo/remote/comment.rb', line 53

def text
  data.text
end