Method: TentD::Model::Follower#as_json

Defined in:
lib/tentd/model/follower.rb

#as_json(options = {}) ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/tentd/model/follower.rb', line 91

def as_json(options = {})
  attributes = super

  attributes.merge!(:profile => profile) if options[:app]

  if options[:app] || options[:self]
    types = notification_subscriptions.all.map { |s| s.type.uri }
    attributes.merge!(:licenses => licenses, :types => types)
  end

  attributes
end