diff --git a/lab2/person.rb b/lab2/person.rb index 506dd81..09ad955 100644 --- a/lab2/person.rb +++ b/lab2/person.rb @@ -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)