Class: Castle::Commands::Authenticate

Inherits:
Object
  • Object
show all
Defined in:
lib/castle/commands/authenticate.rb

Overview

Generates the payload for the authenticate request

Class Method Summary collapse

Class Method Details

.build(options = {}) ⇒ Castle::Command

Parameters:

  • options (Hash) (defaults to: {})

Returns:



10
11
12
13
14
15
16
17
18
19
# File 'lib/castle/commands/authenticate.rb', line 10

def build(options = {})
  Castle::Validators::Present.call(options, %i[event])
  context = Castle::Context::Sanitize.call(options[:context])

  Castle::Command.new(
    'authenticate',
    options.merge(context: context, sent_at: Castle::Utils::GetTimestamp.call),
    :post
  )
end