| 
									
										
										
										
											2017-10-07 17:43:42 +02:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-27 15:55:23 +01:00
										 |  |  | class ActivityPub::EmojiSerializer < ActivityPub::Serializer | 
					
						
							| 
									
										
										
										
											2017-10-07 17:43:42 +02:00
										 |  |  |   include RoutingHelper | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-27 15:55:23 +01:00
										 |  |  |   context_extensions :emoji | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-07 17:43:42 +02:00
										 |  |  |   attributes :id, :type, :name, :updated | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   has_one :icon, serializer: ActivityPub::ImageSerializer | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def id | 
					
						
							|  |  |  |     ActivityPub::TagManager.instance.uri_for(object) | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def type | 
					
						
							|  |  |  |     'Emoji' | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def icon | 
					
						
							|  |  |  |     object.image | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def updated | 
					
						
							|  |  |  |     object.updated_at.iso8601 | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def name | 
					
						
							|  |  |  |     ":#{object.shortcode}:" | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |