Class: ActiveSupport::Messages::RotationConfiguration

Inherits:
Object
  • Object
show all
Defined in:
activesupport/lib/active_support/messages/rotation_configuration.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRotationConfiguration


8
9
10
# File 'activesupport/lib/active_support/messages/rotation_configuration.rb', line 8

def initialize
  @signed, @encrypted = [], []
end

Instance Attribute Details

#encryptedObject (readonly)

Returns the value of attribute encrypted


6
7
8
# File 'activesupport/lib/active_support/messages/rotation_configuration.rb', line 6

def encrypted
  @encrypted
end

#signedObject (readonly)

Returns the value of attribute signed


6
7
8
# File 'activesupport/lib/active_support/messages/rotation_configuration.rb', line 6

def signed
  @signed
end

Instance Method Details

#rotate(kind, *args, **options) ⇒ Object


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'activesupport/lib/active_support/messages/rotation_configuration.rb', line 12

def rotate(kind, *args, **options)
  case kind
  when :signed
    if options&.any?
      @signed << (args << options)
    else
      @signed << args
    end
  when :encrypted
    if options&.any?
      @encrypted << (args << options)
    else
      @encrypted << args
    end
  end
end