Class: Hulse::Utils
- Inherits:
-
Object
- Object
- Hulse::Utils
- Defined in:
- lib/hulse.rb
Class Method Summary collapse
-
.congress_for_year(year) ⇒ Object
this function is more intuitive when you solve for the other side: year = 1789 + (2 * (congress - 1)).
- .convert_year_to_congress_and_session(year) ⇒ Object
Class Method Details
.congress_for_year(year) ⇒ Object
this function is more intuitive when you solve for the other side: year = 1789 + (2 * (congress - 1))
12 13 14 |
# File 'lib/hulse.rb', line 12 def self.congress_for_year(year) ((year.to_i + 1) / 2) - 894 end |
.convert_year_to_congress_and_session(year) ⇒ Object
16 17 18 19 20 |
# File 'lib/hulse.rb', line 16 def self.convert_year_to_congress_and_session(year) congress = congress_for_year year session = year.odd? ? 1 : 2 return [congress, session] end |