Class: Garcon::Crypto::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/garcon/utility/crypto.rb

Overview

A Configuration instance

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) {|_self| ... } ⇒ undefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initialized a configuration instance

Yields:

  • (_self)

Yield Parameters:



118
119
120
121
122
123
# File 'lib/garcon/utility/crypto.rb', line 118

def initialize(options = {})
  @password = options.fetch(:password, nil)
  @salt     = options.fetch(:salt,     nil)

  yield self if block_given?
end

Instance Attribute Details

#:password(: password) ⇒ String

Returns access the password for this instance.

Returns:

  • (String)

    access the password for this instance.



107
# File 'lib/garcon/utility/crypto.rb', line 107

attr_accessor :password

#:salt(: salt) ⇒ String

Returns access the salt for this instance.

Returns:

  • (String)

    access the salt for this instance.



111
# File 'lib/garcon/utility/crypto.rb', line 111

attr_accessor :salt

#passwordObject

Returns the value of attribute password.



107
108
109
# File 'lib/garcon/utility/crypto.rb', line 107

def password
  @password
end

#saltObject

Returns the value of attribute salt.



111
112
113
# File 'lib/garcon/utility/crypto.rb', line 111

def salt
  @salt
end

Instance Method Details

#to_hObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



126
127
128
# File 'lib/garcon/utility/crypto.rb', line 126

def to_h
  { password: password, salt: salt }.freeze
end