Class: Qcourses::RegistrationNotification

Inherits:
Object
  • Object
show all
Defined in:
lib/qcourses/models/postman.rb

Instance Method Summary collapse

Constructor Details

#initialize(employee, event) ⇒ RegistrationNotification

Returns a new instance of RegistrationNotification.



5
6
7
8
# File 'lib/qcourses/models/postman.rb', line 5

def initialize(employee, event)
  @employee = employee
  @event = event
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
18
# File 'lib/qcourses/models/postman.rb', line 15

def ==(other)
  return false unless other.is_a? RegistrationNotification
  return other.employee.email == employee.email && other.event == event
end

#event_nameObject



9
10
11
# File 'lib/qcourses/models/postman.rb', line 9

def event_name
  @event.name
end

#inspectObject



12
13
14
# File 'lib/qcourses/models/postman.rb', line 12

def inspect
  "RegistrationNotification(for: #{employee.name}, about: #{event.name})"
end