https://github.com/melashu/time_greeting_message
This is a simple gem to display a message with the phrase `Good Morning` if it is in the morning, `Good Afternoon` if it is in the afternoon, `Good Evening` if it is in the evening, `Good Night` if it is at night
https://github.com/melashu/time_greeting_message
ruby
Last synced: about 1 year ago
JSON representation
This is a simple gem to display a message with the phrase `Good Morning` if it is in the morning, `Good Afternoon` if it is in the afternoon, `Good Evening` if it is in the evening, `Good Night` if it is at night
- Host: GitHub
- URL: https://github.com/melashu/time_greeting_message
- Owner: melashu
- Created: 2023-05-10T18:50:46.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-13T12:47:03.000Z (about 3 years ago)
- Last Synced: 2025-03-30T08:07:35.075Z (about 1 year ago)
- Topics: ruby
- Language: Ruby
- Homepage:
- Size: 6.84 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📗 Table of Contents
- [📗 Table of Contents](#-table-of-contents)
- [📖 time\_greeting\_message ](#-time_greeting_message-)
- [Installation ](#installation-)
- [Usage](#usage)
- [👥 Authors ](#-authors-)
- [🤝 Contributing ](#-contributing-)
- [⭐️ Show your support ](#️-show-your-support-)
This is a simple gem to display a message with the phrase `Good Morning` if it is in the morning, `Good Afternoon` if it is in the afternoon, `Good Evening` if it is in the evening, `Good Night` if it is at night
Add the following code to you Gemfile
```
gem 'time_greeting_message'
```
or
install the gem on your terminal
```
gem install time_greeting_message
```
### Usage
`require` the gem in your ruby code.
For example you can do this on your employee.rb file
```
require 'time_greeting_message'
class Employee
def welcome(full_name)
"#{Greeting.new.greeting_message} #{full_name}"
end
end
employee = Employee.new
puts employee.welcome("Melashu Amare)
```
The above code will display either of the message below, based on the curent time.
`Good Morning Melashu Amare`
`Good Afternoon Melashu Amare`
`Good Evening Melashu Amare`
`Good Night Melashu Amare`
👤 Melashu Amare
- GitHub: [@melashu](https://github.com/melashu)
- Twitter: [@meshu102](https://twitter.com/meshu102)
- LinkedIn: [Melashu Amare](https://www.linkedin.com/in/melashu-amare/)
Contributions, issues, and feature requests are welcome!
Feel free to check the [issues page.](https://github.com/melashu/time_greeting_message/issues)
Give a star if you like this project!