Class: Pinnable::MarkerSerializer

Inherits:
Object
  • Object
show all
Defined in:
app/serializers/pinnable/marker_serializer.rb

Overview

The wire shape the in-page overlay reads: enough to re-anchor (anchor blob) and to show the note, never the host’s User object — only its captured label.

Instance Method Summary collapse

Constructor Details

#initialize(pin) ⇒ MarkerSerializer

Returns a new instance of MarkerSerializer.



5
# File 'app/serializers/pinnable/marker_serializer.rb', line 5

def initialize(pin) = @pin = pin

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
17
# File 'app/serializers/pinnable/marker_serializer.rb', line 7

def call
  {
    public_id: pin.public_id,
    url: pin.url,
    body: pin.body,
    status: pin.status,
    author_label: pin.author_label,
    anchor: pin.anchor,
    comments: comments
  }
end