Class: TentD::API::Followers::Notify
- Inherits:
-
Middleware
- Object
- Middleware
- TentD::API::Followers::Notify
- Defined in:
- lib/tentd/api/followers.rb
Instance Method Summary collapse
Methods inherited from Middleware
Methods included from Authorizable
#authorize_env!, #authorize_env?
Constructor Details
This class inherits a constructor from TentD::API::Middleware
Instance Method Details
#action(env) ⇒ Object
161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/tentd/api/followers.rb', line 161 def action(env) return env unless follower = env.notify_instance post = Model::Post.create( :type => 'https://tent.io/types/post/follower/v0.1.0', :entity => env['tent.entity'], :content => { :id => follower.public_id, :entity => follower.entity, :action => env.notify_action } ) Notifications.trigger(:type => post.type.uri, :post_id => post.id) env end |