Method: Workpattern::Workpattern#workpattern

Defined in:
lib/workpattern/workpattern.rb

#workpattern(opts = {}) ⇒ Object

Applys a working or resting pattern to the Workpattern object.

The #resting and #working methods are convenience methods that call this with the appropriate :work_type already set.

apply to.It defaults to :all days to apply the pattern. Defaults to 00:00. days to apply the pattern. Defaults to 23:59. Defaults to working.

Options Hash (opts):

  • :start (Date)

    The first date to apply the pattern. Defaults to the start attribute.

  • :finish (Date)

    The last date to apply the pattern. Defaults to the finish attribute.

  • :days (DAYNAMES)

    The specific day or days the pattern will

  • :start_time ((#hour, #min))

    The first time in the selected

  • :finish_time ((#hour, #min))

    The last time in the selected

  • :work_type ((WORK_TYPE || REST_TYPE))

    Either working or resting.

See Also:



153
154
155
156
157
158
159
# File 'lib/workpattern/workpattern.rb', line 153

def workpattern(opts = {})
  if self.class.persistence?
    week_pattern.workpattern(opts, @@persistence)
  else
    week_pattern.workpattern(opts)
  end
end