Class: VacationRentalsIcalAdapters::Adapters::CsvBookedDaysAdapter
- Inherits:
-
Object
- Object
- VacationRentalsIcalAdapters::Adapters::CsvBookedDaysAdapter
- Defined in:
- lib/vacation_rentals_ical_adapters/adapters/csv_booked_days_adapter.rb
Overview
CSV Booked Days response format should be similar to:
2016-12-08,2016-12-09,2016-12-15
Instance Method Summary collapse
Instance Method Details
#applicable?(body:, source:) ⇒ Boolean
10 11 12 13 |
# File 'lib/vacation_rentals_ical_adapters/adapters/csv_booked_days_adapter.rb', line 10 def applicable?(body:, source:) return false if source.nil? source.split(".").last == "booked_days" end |
#to_ical(body) ⇒ Object
15 16 17 18 |
# File 'lib/vacation_rentals_ical_adapters/adapters/csv_booked_days_adapter.rb', line 15 def to_ical(body) events = parse_events(body) VacationRentalsIcalAdapters::IcalConverter.to_ical(events) end |