Sha256: 4b9090f459edc6d487c180acfbb1dd032c636d754d30127aa78f8a31854c4fd2

Contents?: true

Size: 579 Bytes

Versions: 1

Compression:

Stored size: 579 Bytes

Contents

module ErpWorkEffort
  module Config
    class << self

      attr_accessor :days_per_month, :days_per_week, :hours_per_day

      def init!
        @defaults = {
          :@days_per_month => 20,
          :@days_per_week => 5,
          :@hours_per_day => 8
        }
      end

      def reset!
        @defaults.each do |k,v|
          instance_variable_set(k,v)
        end
      end

      def configure(&blk)
        @configure_blk = blk
      end

      def configure!
        @configure_blk.call(self) if @configure_blk
      end

    end
    init!
    reset!
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
erp_work_effort-4.2.0 lib/erp_work_effort/config.rb