Class: VacationRentalsIcalAdapters::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/vacation_rentals_ical_adapters/registry.rb

Defined Under Namespace

Classes: AdapterNotFoundError

Instance Method Summary collapse

Constructor Details

#initializeRegistry

Returns a new instance of Registry.



5
6
7
# File 'lib/vacation_rentals_ical_adapters/registry.rb', line 5

def initialize
  @adapters = []
end

Instance Method Details

#find_adapter(&block) ⇒ Object



9
10
11
# File 'lib/vacation_rentals_ical_adapters/registry.rb', line 9

def find_adapter(&block)
  adapters.find(adapter_not_found_proc, &block)
end

#register(adapter) ⇒ Object



13
14
15
# File 'lib/vacation_rentals_ical_adapters/registry.rb', line 13

def register(adapter)
  adapters << adapter
end