Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joker1007/keyword_arg_time
Time or Date object constructer by keyword arguments
https://github.com/joker1007/keyword_arg_time
Last synced: 2 days ago
JSON representation
Time or Date object constructer by keyword arguments
- Host: GitHub
- URL: https://github.com/joker1007/keyword_arg_time
- Owner: joker1007
- License: mit
- Created: 2014-01-10T07:03:37.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-10T07:21:26.000Z (almost 11 years ago)
- Last Synced: 2024-04-15T22:38:40.425Z (7 months ago)
- Language: Ruby
- Homepage:
- Size: 125 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# KeywordArgTime
[![Build Status](https://travis-ci.org/joker1007/keyword_arg_time.png?branch=master)](https://travis-ci.org/joker1007/keyword_arg_time)
[![Coverage Status](https://coveralls.io/repos/joker1007/keyword_arg_time/badge.png?branch=master)](https://coveralls.io/r/joker1007/keyword_arg_time?branch=master)Time or Date object constructer by keyword arguments
## Installation
Add this line to your application's Gemfile:
gem 'keyword_arg_time'
And then execute:
$ bundle
Or install it yourself as:
$ gem install keyword_arg_time
## Usage
```ruby
require 'keyword_arg_time'Time.now(hour: 10, min: 15, sec: 0) # => 2014-01-10 10:15:00 +0900
time = Time.local(2014, 1, 10) # => 2014-01-10 00:00:00 +0900
time.copy(hour: 10, min: 15) # => 2014-01-10 10:15:00 +0900Date.today(mon: 3) # =>
date = Date.new(2014, 1, 10) # =>
date.copy(day: 25) # =>
```## Contributing
1. Fork it ( http://github.com//keyword_arg_time/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request