Class: Castle::Commands::StartImpersonation
- Inherits:
-
Object
- Object
- Castle::Commands::StartImpersonation
- Defined in:
- lib/castle/commands/start_impersonation.rb
Overview
builder for impersonate command
Class Method Summary collapse
Class Method Details
.build(options = {}) ⇒ Castle::Command
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/castle/commands/start_impersonation.rb', line 10 def build( = {}) Castle::Validators::Present.call(, %i[user_id]) context = Castle::Context::Sanitize.call([:context]) Castle::Validators::Present.call(context, %i[user_agent ip]) Castle::Command.new( 'impersonate', .merge(context: context, sent_at: Castle::Utils::GetTimestamp.call), :post ) end |