Class: Decentworks::DateSupport::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/decentworks/date_support/configuration.rb,
sig/decentworks/date_support/configuration.rbs

Constant Summary collapse

MONTHS =

{ january: 1, february: 2, ... december: 12 }

Returns:

  • (Hash[Symbol, Integer])
::Date::MONTHNAMES
.each_with_index
.filter_map { |name, index| [ name.downcase.to_sym, index ] if name }
.to_h
.freeze
DEFAULT =

開始月の初期値(1月)

Returns:

  • (Symbol)
:january

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



51
52
53
# File 'lib/decentworks/date_support/configuration.rb', line 51

def initialize
  @first_quarter_month_name = DEFAULT
end

Instance Attribute Details

#first_quarter_month_nameSymbol

開始月名

Returns:

  • (Symbol)


49
50
51
# File 'lib/decentworks/date_support/configuration.rb', line 49

def first_quarter_month_name
  @first_quarter_month_name
end

Instance Method Details

#first_quarter_monthInteger

開始月数

Returns:

  • (Integer)


65
# File 'lib/decentworks/date_support/configuration.rb', line 65

def first_quarter_month = MONTHS.fetch(first_quarter_month_name)

#first_quarter_month_offsetInteger

1月始まりとの開始月のずれ

Returns:

  • (Integer)


68
69
70
# File 'lib/decentworks/date_support/configuration.rb', line 68

def first_quarter_month_offset
  first_quarter_month - 1
end