Class: Services::UpdateFacilityMappingContext

Inherits:
Object
  • Object
show all
Defined in:
app/contexts/services/update_facility_mapping_context.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(facility_mapping, params) ⇒ UpdateFacilityMappingContext

Returns a new instance of UpdateFacilityMappingContext.



11
12
13
14
15
# File 'app/contexts/services/update_facility_mapping_context.rb', line 11

def initialize(facility_mapping, params)
  @facility_mapping = facility_mapping
  @params = params
  @facility_mapping.extend Services::FacilityMappingUpdater
end

Instance Attribute Details

#facility_mappingObject

Returns the value of attribute facility_mapping.



5
6
7
# File 'app/contexts/services/update_facility_mapping_context.rb', line 5

def facility_mapping
  @facility_mapping
end

#paramsObject

Returns the value of attribute params.



5
6
7
# File 'app/contexts/services/update_facility_mapping_context.rb', line 5

def params
  @params
end

Class Method Details

.call(facility_mapping, params) ⇒ Object



7
8
9
# File 'app/contexts/services/update_facility_mapping_context.rb', line 7

def self.call(facility_mapping, params)
  UpdateFacilityMappingContext.new(facility_mapping, params).call
end

Instance Method Details

#callObject



17
18
19
# File 'app/contexts/services/update_facility_mapping_context.rb', line 17

def call
  facility_mapping.update(params)
end