Class: Availabiliter::OptionsValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/availabiliter/options_validator.rb

Overview

Verify that the options input are valid

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(minimum_availability_start:, maximum_availability_end:, format:, **_options) ⇒ OptionsValidator

Returns a new instance of OptionsValidator.



6
7
8
9
10
# File 'lib/availabiliter/options_validator.rb', line 6

def initialize(minimum_availability_start:, maximum_availability_end:, format:, **_options)
  @minimum_availability_start = minimum_availability_start
  @maximum_availability_end = maximum_availability_end
  @format = format
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format.



4
5
6
# File 'lib/availabiliter/options_validator.rb', line 4

def format
  @format
end

#maximum_availability_endObject (readonly)

Returns the value of attribute maximum_availability_end.



4
5
6
# File 'lib/availabiliter/options_validator.rb', line 4

def maximum_availability_end
  @maximum_availability_end
end

#minimum_availability_startObject (readonly)

Returns the value of attribute minimum_availability_start.



4
5
6
# File 'lib/availabiliter/options_validator.rb', line 4

def minimum_availability_start
  @minimum_availability_start
end

Instance Method Details

#callObject



12
13
14
15
16
# File 'lib/availabiliter/options_validator.rb', line 12

def call
  validate_format
  validate_boundary_class
  validate_boundary_value
end