Module: RisingSun::Fiscali::ClassMethods
- Defined in:
- lib/rising_sun/fiscali.rb
Instance Method Summary collapse
- #financial_months ⇒ Object
- #financial_year_start(year = Date.today.year) ⇒ Object
- #fiscal_zone ⇒ Object
- #fiscal_zone=(zone) ⇒ Object
- #fy_start_month ⇒ Object
- #fy_start_month=(month) ⇒ Object
- #reset_forward_year! ⇒ Object
- #use_forward_year! ⇒ Object
- #uses_forward_year? ⇒ Boolean
Instance Method Details
#financial_months ⇒ Object
35 36 37 |
# File 'lib/rising_sun/fiscali.rb', line 35 def financial_months (1..12).map{|m| ((m - 1 + fy_start_month)%12.1).ceil } end |
#financial_year_start(year = Date.today.year) ⇒ Object
31 32 33 |
# File 'lib/rising_sun/fiscali.rb', line 31 def financial_year_start(year=Date.today.year) uses_forward_year? ? new(year - 1,fy_start_month,1) : new(year,fy_start_month,1) end |
#fiscal_zone ⇒ Object
22 23 24 |
# File 'lib/rising_sun/fiscali.rb', line 22 def fiscal_zone @fiscali_zone end |
#fiscal_zone=(zone) ⇒ Object
13 14 15 16 |
# File 'lib/rising_sun/fiscali.rb', line 13 def fiscal_zone=(zone) @fiscali_start_month = FISCAL_ZONE[zone] || FY_START_MONTH @fiscali_zone = zone end |
#fy_start_month ⇒ Object
18 19 20 |
# File 'lib/rising_sun/fiscali.rb', line 18 def fy_start_month @fiscali_start_month || FY_START_MONTH end |
#fy_start_month=(month) ⇒ Object
26 27 28 29 |
# File 'lib/rising_sun/fiscali.rb', line 26 def fy_start_month=(month) @fiscali_zone = nil @fiscali_start_month = month end |
#reset_forward_year! ⇒ Object
43 44 45 |
# File 'lib/rising_sun/fiscali.rb', line 43 def reset_forward_year! @fy_forward = false end |
#use_forward_year! ⇒ Object
39 40 41 |
# File 'lib/rising_sun/fiscali.rb', line 39 def use_forward_year! @fy_forward = true end |
#uses_forward_year? ⇒ Boolean
47 48 49 |
# File 'lib/rising_sun/fiscali.rb', line 47 def uses_forward_year? @fy_forward || false end |