Class: Hoodie::Crypto::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/hoodie/utils/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:



110
111
112
113
114
115
# File 'lib/hoodie/utils/crypto.rb', line 110

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.



99
# File 'lib/hoodie/utils/crypto.rb', line 99

attr_accessor :password

#:salt(: salt) ⇒ String

Returns access the salt for this instance.

Returns:

  • (String)

    access the salt for this instance.



103
# File 'lib/hoodie/utils/crypto.rb', line 103

attr_accessor :salt

#passwordObject

Returns the value of attribute password.



99
100
101
# File 'lib/hoodie/utils/crypto.rb', line 99

def password
  @password
end

#saltObject

Returns the value of attribute salt.



103
104
105
# File 'lib/hoodie/utils/crypto.rb', line 103

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.



118
119
120
# File 'lib/hoodie/utils/crypto.rb', line 118

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