refactor: remove git validation from initializer and add setter method in Person class

lab2
Artem-Darius Weber 1 week ago
parent a9717abae8
commit 3fade34834

@ -5,7 +5,6 @@ class Person
def initialize(id:, git:, contact: Contact.new)
validate_id(id)
validate_git(git)
validate_contact(contact)
@id = id
@ -33,6 +32,11 @@ class Person
id.is_a?(String) && !id.strip.empty?
end
def git=(git)
validate_git(git)
@git = git
end
private
def validate_id(id)

Loading…
Cancel
Save