Sha256: 342692ad86154d22253f3dd2ade01894b319ffdf02cfcd70f4b83e49fa6ef32f

Contents?: true

Size: 481 Bytes

Versions: 20

Compression:

Stored size: 481 Bytes

Contents

module Renalware
  module Clinics
    class BuildVisitFromAppointment
      def initialize(appointment)
        @appointment = appointment
      end

      def call(opts = {})
        visit = appointment.patient.clinic_visits.build(opts)
        visit.clinic = appointment.clinic
        starts_at = appointment.starts_at
        visit.date = starts_at.to_date
        visit.time = starts_at
        visit
      end

      private

      attr_reader :appointment
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
renalware-core-2.0.8 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.7 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.5 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.4 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.3 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.2 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.1 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.rc13 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.rc11 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.rc10 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.rc9 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.rc8 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.rc7 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.rc6 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.rc5 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.rc4 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.rc3 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.rc1 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.beta12 app/models/renalware/clinics/build_visit_from_appointment.rb