Last active
February 23, 2025 17:44
-
-
Save max-power/d576d70e6f97440d3684fe44bbc6e8b2 to your computer and use it in GitHub Desktop.
Chinese Zodiac Animals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZodiacAnimal = Data.define(:icon, :name, :chinese_name, :earthly_branch, :element, :trine, :yin) do | |
def self.all | |
[ | |
new( icon: "π", name: "Rat", chinese_name: "ιΌ ", earthly_branch: "ε", element: "Water", trine: 1, yin: false ), | |
new( icon: "π", name: "Ox", chinese_name: "η", earthly_branch: "δΈ", element: "Earth", trine: 2, yin: true ), | |
new( icon: "π ", name: "Tiger", chinese_name: "θ", earthly_branch: "ε― ", element: "Wood" , trine: 3, yin: false ), | |
new( icon: "π", name: "Rabbit", chinese_name: "ε ", earthly_branch: "ε―", element: "Wood" , trine: 4, yin: true ), | |
new( icon: "π", name: "Dragon", chinese_name: "ιΎ", earthly_branch: "θΎ°", element: "Earth", trine: 1, yin: false), | |
new( icon: "π", name: "Snake", chinese_name: "θ", earthly_branch: "ε·³", element: "Fire" , trine: 2, yin: true ), | |
new( icon: "π", name: "Horse", chinese_name: "马", earthly_branch: "ε", element: "Fire" , trine: 3, yin: false), | |
new( icon: "π", name: "Goat", chinese_name: "ηΎ", earthly_branch: "ζͺ", element: "Earth", trine: 4, yin: true ), | |
new( icon: "π", name: "Monkey", chinese_name: "η΄", earthly_branch: "η³", element: "Metal", trine: 1, yin: false), | |
new( icon: "π", name: "Rooster", chinese_name: "ιΈ‘", earthly_branch: "ι ", element: "Metal", trine: 2, yin: true ), | |
new( icon: "π", name: "Dog", chinese_name: "η", earthly_branch: "ζ", element: "Earth", trine: 3, yin: false), | |
new( icon: "π", name: "Pig", chinese_name: "ηͺ", earthly_branch: "δΊ₯", element: "Water", trine: 4, yin: true ), | |
] | |
end | |
def self.for_year(year) | |
all[(year - 4) % 12] # 4 is the base year (Rat starts in 4 AD) | |
end | |
def yin? = yin | |
def yang? = !yin | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment