timingiseverything 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/timingiseverything.rb +32 -0
- metadata +43 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fbb9d6c91888cbc26269a0aaa37ca8f4f3d9e06774727cfd5c42826bfbecc25e
|
4
|
+
data.tar.gz: ce4055e0d25b825f496abfa174dd58a9bf345dbb4620eadac512b12c7002fc42
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c6520fb25d9c5fd1b58fc06f4043d279d61bf9d7b76e60b4f24df72ab210254de31550e1f6a76a91618da314ce826e3b9c5b09eab4f8e8563377adfa63911789
|
7
|
+
data.tar.gz: 9f7e585150be77c64cc46359dd93d2b36785492e4645c7a14706d5f9abcd7c159459fdfd9cb3dd78207206f9c0ff1d04c240718bba69e361b35c869d08a3c24a
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class TimingIsEverything
|
2
|
+
|
3
|
+
def self.morning?(time)
|
4
|
+
(5..11).include? time.hour
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.afternoon?(time)
|
8
|
+
(12..17).include? time.hour
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.evening?(time)
|
12
|
+
(18..20).include? time.hour
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.night?(time)
|
16
|
+
(21..4).include? time.hour
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.part_of_day
|
20
|
+
time = Time.now
|
21
|
+
if self.morning?(time)
|
22
|
+
puts "Good morning!"
|
23
|
+
elsif self.afternoon?(time)
|
24
|
+
puts "Good afternoon!"
|
25
|
+
elsif self.evening?(time)
|
26
|
+
puts "Good evening!"
|
27
|
+
else
|
28
|
+
puts "Please, go to sleep!"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: timingiseverything
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Aaron Groch
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-01-10 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A gem that tells you what part of the day it is
|
14
|
+
email: aaron@aarongroch.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/timingiseverything.rb
|
20
|
+
homepage: https://rubygems.org/gems/timingiseverything
|
21
|
+
licenses:
|
22
|
+
- MIT
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubygems_version: 3.0.6
|
40
|
+
signing_key:
|
41
|
+
specification_version: 4
|
42
|
+
summary: What part of the day is it?
|
43
|
+
test_files: []
|