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
-
#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.
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_name ⇒ 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_month ⇒ Integer
開始月数
65 |
# File 'lib/decentworks/date_support/configuration.rb', line 65 def first_quarter_month = MONTHS.fetch(first_quarter_month_name) |
#first_quarter_month_offset ⇒ Integer
1月始まりとの開始月のずれ
68 69 70 |
# File 'lib/decentworks/date_support/configuration.rb', line 68 def first_quarter_month_offset first_quarter_month - 1 end |