class VacationRentalsIcalAdapters::Registry

Attributes

adapters[R]

Public Class Methods

new() click to toggle source
# File lib/vacation_rentals_ical_adapters/registry.rb, line 5
def initialize
  @adapters = []
end

Public Instance Methods

find_adapter(&block) click to toggle source
# File lib/vacation_rentals_ical_adapters/registry.rb, line 9
def find_adapter(&block)
  adapters.find(adapter_not_found_proc, &block)
end
register(adapter) click to toggle source
# File lib/vacation_rentals_ical_adapters/registry.rb, line 13
def register(adapter)
  adapters << adapter
end

Private Instance Methods

adapter_not_found_proc() click to toggle source
# File lib/vacation_rentals_ical_adapters/registry.rb, line 19
def adapter_not_found_proc
  -> { raise AdapterNotFoundError }
end