diff options
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/world.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/lib/world.rb b/app/lib/world.rb new file mode 100644 index 0000000..f767419 --- /dev/null +++ b/app/lib/world.rb @@ -0,0 +1,14 @@ +class World + def self.time_of_day + hour = Time.current.hour + if [2, 14].include? hour + :firstlight + elsif (hour >= 3 && hour < 8) || (hour >= 15 && hour < 20) + :day + elsif [8, 20].include? hour + :twilight + else + :night + end + end +end |