class UserConfiguration

Attributes

email[R]
initials[R]
key[R]
name[R]

Public Class Methods

new(name: nil, email: nil, key: nil, initials: nil) click to toggle source
# File lib/user_configuration.rb, line 4
def initialize(name: nil, email: nil, key: nil, initials: nil)
  @name = name
  @email = email
  @key = key
  @initials = initials

  raise 'User Information Missing' unless everything_defined?
end

Public Instance Methods

==(other) click to toggle source
# File lib/user_configuration.rb, line 13
def ==(other)
  state_variables == other.state_variables
end

Protected Instance Methods

state_variables() click to toggle source
# File lib/user_configuration.rb, line 27
def state_variables
  [name, email, key, initials]
end

Private Instance Methods

everything_defined?() click to toggle source
# File lib/user_configuration.rb, line 19
def everything_defined?
  [name, email, key, initials].all? do |attribute|
    attribute.class == String && !attribute.empty?
  end
end