Class: Olyx::Guardrails::PolicyComponents::IdentityConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/olyx/guardrails/policy/configuration.rb

Overview

Validated policy identity and bounded input limit.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, max_input_length) ⇒ IdentityConfiguration

Returns a new instance of IdentityConfiguration.



22
23
24
25
26
# File 'lib/olyx/guardrails/policy/configuration.rb', line 22

def initialize(name, max_input_length)
  @name = Name.call(name)
  @max_input_length = Validation.non_negative_integer!(max_input_length, name: 'policy max_input_length')
  freeze
end

Instance Attribute Details

#max_input_lengthObject (readonly)

Returns the value of attribute max_input_length.



20
21
22
# File 'lib/olyx/guardrails/policy/configuration.rb', line 20

def max_input_length
  @max_input_length
end

#nameObject (readonly)

Returns the value of attribute name.



20
21
22
# File 'lib/olyx/guardrails/policy/configuration.rb', line 20

def name
  @name
end