Class: LDIF::DSL::Person::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/ldif/dsl/person.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



37
38
39
# File 'lib/ldif/dsl/person.rb', line 37

def build
  Person.new(@first_name, @second_name, @password)
end

#first_name(first_name) ⇒ Object



22
23
24
25
# File 'lib/ldif/dsl/person.rb', line 22

def first_name(first_name)
  @first_name = first_name
  self
end

#password(plain_password) ⇒ Object



32
33
34
35
# File 'lib/ldif/dsl/person.rb', line 32

def password(plain_password)
  @password = "{SHA}#{Digest::SHA1.base64digest(plain_password)}"
  self
end

#second_name(second_name) ⇒ Object



27
28
29
30
# File 'lib/ldif/dsl/person.rb', line 27

def second_name(second_name)
  @second_name = second_name
  self
end