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
Instance Method Details
#financial_months ⇒ Object
37 38 39 |
# File 'lib/rising_sun/fiscali.rb', line 37 def financial_months (1..12).map{|m| ((m - 1 + fy_start_month)%12.1).ceil } end |
#financial_year_start(year = Date.today.year) ⇒ Object
33 34 35 |
# File 'lib/rising_sun/fiscali.rb', line 33 def financial_year_start(year=Date.today.year) Date.new(year,fy_start_month,1) end |
#fiscal_zone ⇒ Object
24 25 26 |
# File 'lib/rising_sun/fiscali.rb', line 24 def fiscal_zone read_inheritable_attribute(:zone) end |
#fiscal_zone=(zone) ⇒ Object
15 16 17 18 |
# File 'lib/rising_sun/fiscali.rb', line 15 def fiscal_zone=(zone) write_inheritable_attribute(:start_month, FISCAL_ZONE[zone] || FY_START_MONTH) write_inheritable_attribute(:zone,zone) end |
#fy_start_month ⇒ Object
20 21 22 |
# File 'lib/rising_sun/fiscali.rb', line 20 def fy_start_month read_inheritable_attribute(:start_month) || FY_START_MONTH end |
#fy_start_month=(month) ⇒ Object
28 29 30 31 |
# File 'lib/rising_sun/fiscali.rb', line 28 def fy_start_month=(month) write_inheritable_attribute(:zone, nil) write_inheritable_attribute(:start_month,month) end |