Project

shengxiao

0.0
No commit activity in last 3 years
No release in over 3 years
Chinese zodiac calculator gem
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 10.0

Runtime

~> 0.8.0
 Project Readme

Shengxiao | 生肖

Shengxiao is a Chinese zodiac sign calculator. It provides you a Chinese zodiac sign by a given date.

Installation

You can add it to your Gemfile with:

gem 'shengxiao'

or

gem install shengxiao

Then run bundle install

Usage

ShengXiao.sign(Date.today)        # => Rooster

# or pass a string with date
ShengXiao.sign("07.01.1997")      # => Rat

You can also call chinese_zodiac_sign method on Date/DateTime class objects.

Date.new(2014, 3, 20).chinese_zodiac_sign              # => Horse

DateTime.new(2001,2,3,4,5,6,'+7').chinese_zodiac_sign  # => Snake

Included locales

  • en (English)
  • ru (Russian)
  • zh-CN (Chinese)

Changelog

  • 0.0.1 Initial version with [:en, :ru, :zh-CN] locales
  • 0.1.0 Add method to Date, DateTime class object