Class: Trello::Notification

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BasicData

#==, #initialize, many, one, #refresh!, register_attributes

Constructor Details

This class inherits a constructor from Trello::BasicData

Class Method Details

.find(id) ⇒ Object

Locate a notification by its id



9
10
11
# File 'lib/trello/notification.rb', line 9

def find(id)
  super(:notifications, id)
end

Instance Method Details

#boardObject



28
29
30
# File 'lib/trello/notification.rb', line 28

def board
  Client.get("/notifications/#{id}/board").json_into(Board)
end

#cardObject



36
37
38
# File 'lib/trello/notification.rb', line 36

def card
  Client.get("/notifications/#{id}/card").json_into(Card)
end

#listObject



32
33
34
# File 'lib/trello/notification.rb', line 32

def list
  Client.get("/notifications/#{id}/list").json_into(List)
end

#memberObject



40
41
42
# File 'lib/trello/notification.rb', line 40

def member
  Client.get("/notifications/#{id}/member").json_into(Member)
end

#organizationObject



44
45
46
# File 'lib/trello/notification.rb', line 44

def organization
  Client.get("/notifications/#{id}/organization").json_into(Organization)
end

#update_fields(fields) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/trello/notification.rb', line 14

def update_fields(fields)
  attributes[:id]                = fields['id']
  attributes[:unread]            = fields['unread']
  attributes[:type]              = fields['type']
  attributes[:date]              = fields['date']
  attributes[:data]              = fields['data']
  attributes[:member_creator_id] = fields['idMemberCreator']
  self
end