Class: SDM::SecretEnginePasswordPolicy

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(allow_repeat: nil, exclude_characters: nil, exclude_upper_case: nil, length: nil, num_digits: nil, num_symbols: nil) ⇒ SecretEnginePasswordPolicy

Returns a new instance of SecretEnginePasswordPolicy.



13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
# File 'lib/models/porcelain.rb', line 13808

def initialize(
  allow_repeat: nil,
  exclude_characters: nil,
  exclude_upper_case: nil,
  length: nil,
  num_digits: nil,
  num_symbols: nil
)
  @allow_repeat = allow_repeat == nil ? false : allow_repeat
  @exclude_characters = exclude_characters == nil ? "" : exclude_characters
  @exclude_upper_case = exclude_upper_case == nil ? false : exclude_upper_case
  @length = length == nil ? 0 : length
  @num_digits = num_digits == nil ? 0 : num_digits
  @num_symbols = num_symbols == nil ? 0 : num_symbols
end

Instance Attribute Details

#allow_repeatObject

If set to true allows for consecutive characters to repeat itself



13796
13797
13798
# File 'lib/models/porcelain.rb', line 13796

def allow_repeat
  @allow_repeat
end

#exclude_charactersObject

Characters to exclude when generating password



13798
13799
13800
# File 'lib/models/porcelain.rb', line 13798

def exclude_characters
  @exclude_characters
end

#exclude_upper_caseObject

If set to true do not include upper case letters when generating password



13800
13801
13802
# File 'lib/models/porcelain.rb', line 13800

def exclude_upper_case
  @exclude_upper_case
end

#lengthObject

Password length.



13802
13803
13804
# File 'lib/models/porcelain.rb', line 13802

def length
  @length
end

#num_digitsObject

Numbers of digits to use when generating password



13804
13805
13806
# File 'lib/models/porcelain.rb', line 13804

def num_digits
  @num_digits
end

#num_symbolsObject

Number of symbols to use when generating password



13806
13807
13808
# File 'lib/models/porcelain.rb', line 13806

def num_symbols
  @num_symbols
end

Instance Method Details

#to_json(options = {}) ⇒ Object



13824
13825
13826
13827
13828
13829
13830
# File 'lib/models/porcelain.rb', line 13824

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end