Class: VacationRentalsIcalAdapters::Registry
- Inherits:
-
Object
- Object
- VacationRentalsIcalAdapters::Registry
- Defined in:
- lib/vacation_rentals_ical_adapters/registry.rb
Defined Under Namespace
Classes: AdapterNotFoundError
Instance Method Summary collapse
- #find_adapter(&block) ⇒ Object
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
- #register(adapter) ⇒ Object
Constructor Details
#initialize ⇒ Registry
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 |