Class: CoronaPresenceTracing::CheckInValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/corona_presence_tracing/validator.rb

Direct Known Subclasses

CWACheckInValidator

Instance Method Summary collapse

Constructor Details

#initialize(check_in) ⇒ CheckInValidator

Returns a new instance of CheckInValidator.



16
17
18
# File 'lib/corona_presence_tracing/validator.rb', line 16

def initialize(check_in)
  @check_in = check_in
end

Instance Method Details

#validateObject



20
21
22
23
24
25
26
# File 'lib/corona_presence_tracing/validator.rb', line 20

def validate
  validate_presence_of :description, :address
  validate_type_of :description, :address, %w[String]
  validate_length_of :description, :address, max: 100
  validate_type_of :start_time, :end_time, %w[DateTime Time Date ActiveSupport::TimeWithZone]
  validate_dates
end