Sha256: 4c89fe47a1e2d516d152eb465c626d71b2203577629b3408b0bf0680d22c120c

Contents?: true

Size: 389 Bytes

Versions: 9

Compression:

Stored size: 389 Bytes

Contents

module ForemanPatch
  module CyclesHelper

    def cycle_length(cycle)
      if ForemanPatch::Cycle === cycle
        cycle = cycle.plan
      end

      cycle.interval.send(cycle.units).value / ActiveSupport::Duration::SECONDS_PER_DAY
    end

    def cycle_windows(cycle, date)
      cycle.windows.select do |window|
        window.start_at.to_date === date
      end
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
foreman_patch-1.2.1 app/helpers/foreman_patch/cycles_helper.rb
foreman_patch-1.2.0 app/helpers/foreman_patch/cycles_helper.rb
foreman_patch-1.2.0.alpha1 app/helpers/foreman_patch/cycles_helper.rb
foreman_patch-1.1.6.alpha5 app/helpers/foreman_patch/cycles_helper.rb
foreman_patch-1.1.6.alpha4 app/helpers/foreman_patch/cycles_helper.rb
foreman_patch-1.1.5 app/helpers/foreman_patch/cycles_helper.rb
foreman_patch-1.1.4 app/helpers/foreman_patch/cycles_helper.rb
foreman_patch-1.1.3 app/helpers/foreman_patch/cycles_helper.rb
foreman_patch-1.1.1 app/helpers/foreman_patch/cycles_helper.rb