Class: TentD::API::Groups::Notify
- Inherits:
-
Middleware
- Object
- Middleware
- TentD::API::Groups::Notify
- Defined in:
- lib/tentd/api/groups.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
106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/tentd/api/groups.rb', line 106 def action(env) return env unless group = env.notify_instance post = Model::Post.create( :type => 'https://tent.io/types/post/group/v0.1.0', :entity => env['tent.entity'], :content => { :id => group.public_id, :name => group.name, :action => env.notify_action } ) Notifications.trigger(:type => post.type.uri, :post_id => post.id) env end |