Patches Date
and Time
to add methods and convert to Japanese Ehou direction.
Ehou is the lucky direction of the year which is determined every year by the Celestial stems. It is customary in Japan at Setsubun (celebrated on Feb 3) to eat a special sushi roll in silence facing the "Ehou" direction for good fortune.
Have a great Setsubun!
For more info on "Ehou", see: Ehou
require 'ehou'
Date.new(2015).ehou # "西南西"
Date.new(2015).ehou.angle # 255 (0 means north, 90 is east, 180 is south)
Date.new(2015).ehou.to_en # "West-southwest"
Date.new(2015).ehou.shorten # "WSW"
Time.local(2016).ehou # "南南東"
Time.local(2016).ehou.angle # 165
Time.local(2016).ehou.to_en # "South-southeast"
Time.local(2016).ehou.shorten # "SSE"
Add this line to your application's Gemfile:
gem 'ehou'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ehou
- Fork it ( https://github.com/koozyt/ehou/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Make sure all your changes are covered by tests
- Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request