Sha256: 513c46c0241016626c9490eb3d134e5d0a911d0f79c56b1ba8a8386b4eb6c3b6

Contents?: true

Size: 482 Bytes

Versions: 8

Compression:

Stored size: 482 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

8 entries across 8 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta11 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.beta10 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.beta9 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.beta8 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.beta7 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.beta6 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.beta5 app/models/renalware/clinics/build_visit_from_appointment.rb
renalware-core-2.0.0.pre.beta4 app/models/renalware/clinics/build_visit_from_appointment.rb