Class: Decentworks::DateSupport::Configuration
- Inherits:
-
Object
- Object
- Decentworks::DateSupport::Configuration
- Defined in:
- lib/decentworks/date_support/configuration.rb,
sig/decentworks/date_support/configuration.rbs
Constant Summary collapse
- MONTHS =
{ january: 1, february: 2, ... december: 12 }
::Date::MONTHNAMES .each_with_index .filter_map { |name, index| [name.downcase.to_sym, index] if name } .to_h .freeze
- DEFAULT =
開始月の初期値(1月)
:january
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#beginning_of_first_quarter_month ⇒ Integer
開始月数.
-
#first_quarter_month_offset ⇒ Integer
1月始まりとの開始月のずれ.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
50 51 52 |
# File 'lib/decentworks/date_support/configuration.rb', line 50 def initialize @beginning_of_first_quarter = DEFAULT end |
Instance Attribute Details
#beginning_of_first_quarter ⇒ Symbol
開始月
48 49 50 |
# File 'lib/decentworks/date_support/configuration.rb', line 48 def beginning_of_first_quarter @beginning_of_first_quarter end |
Instance Method Details
#beginning_of_first_quarter_month ⇒ Integer
開始月数
64 |
# File 'lib/decentworks/date_support/configuration.rb', line 64 def beginning_of_first_quarter_month = MONTHS.fetch(beginning_of_first_quarter) |
#first_quarter_month_offset ⇒ Integer
1月始まりとの開始月のずれ
67 68 69 |
# File 'lib/decentworks/date_support/configuration.rb', line 67 def first_quarter_month_offset beginning_of_first_quarter_month - 1 end |