Module: DateUtils::Common

Included in:
Month, Week, Year
Defined in:
lib/date_utils.rb

Overview

common to Year/Month/Week

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extract_options_from_args!(args) ⇒ Object



44
45
46
47
# File 'lib/date_utils.rb', line 44

def self.extract_options_from_args!(args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  options
end

Instance Method Details

#include?(date) ⇒ Boolean

Returns:

  • (Boolean)


36
37
38
39
40
41
42
# File 'lib/date_utils.rb', line 36

def include?(date)
  if date.instance_of?(Date)
    self.respond_to?('days') && self.days.include?(date)
  else
    raise ArgumentError, "need Date as input or no instance variable 'days'..."
  end
end