Class: ReservationService::FormFactory

Inherits:
Object
  • Object
show all
Defined in:
app/services/reservation_service/form_factory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params, reservation = nil) ⇒ FormFactory

Returns a new instance of FormFactory.



4
5
6
7
# File 'app/services/reservation_service/form_factory.rb', line 4

def initialize(params, reservation = nil)
  @params = params
  @reservation = reservation
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



2
3
4
# File 'app/services/reservation_service/form_factory.rb', line 2

def params
  @params
end

#reservationObject (readonly)

Returns the value of attribute reservation.



2
3
4
# File 'app/services/reservation_service/form_factory.rb', line 2

def reservation
  @reservation
end

Instance Method Details

#create_form_serviceObject



9
10
11
# File 'app/services/reservation_service/form_factory.rb', line 9

def create_form_service
  form_service_class.new(params, reservation)
end