time_greeting_message 0.0.1

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/time_greeting_message.rb +14 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 946b10f9c8cba2d14b51cea73da0623ed8651e95a79f5c937624433c831fc283
4
+ data.tar.gz: 3706f1af38d4c57e84959dd78d55cdf60d0823178f53291e6749ab33e161b3ed
5
+ SHA512:
6
+ metadata.gz: d0f840c9fcb357f39d598d5c9410f0f2f0cc6ef70a6abca28386814c4e192da2e9b2dc57ece6dbe3aad083eb8d6799d0550ff0675140ddc3e97fc6d3fcb0cd8c
7
+ data.tar.gz: 99a801b11bcf3717936d218a10689f5749dd525ed06cf8c5a13288c5f33cc8ca14e18ba31aef277cf58137f17589ad66b39cdab01ab6106283986db6107ddcfe
@@ -0,0 +1,14 @@
1
+ class Greeting
2
+ def greeting_message
3
+ hour = Time.now.hour
4
+ if hour >= 6 && hour <= 12
5
+ 'Good Morning'
6
+ elsif hour > 12 && hour <= 18
7
+ 'Good Afternone'
8
+ elsif hour > 18 && hour <= 23
9
+ 'Good Evening'
10
+ else
11
+ 'Good Night'
12
+ end
13
+ end
14
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: time_greeting_message
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Melashu Amare
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-05-10 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: This gem Display a message with the phrase Good morning if it is in the
14
+ morning, Good afternoon if it is in the afternoon, Good evening if it is in the
15
+ evening, Good night if it is at night
16
+ email:
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - lib/time_greeting_message.rb
22
+ homepage:
23
+ licenses: []
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.6.0
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubygems_version: 3.3.26
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: This gem provide greeting message based on current time
44
+ test_files: []