From d6e7789416a844e0de2d5b8c2fecbbbe7ae32e34 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 18 Apr 2024 08:13:29 -0400 Subject: [PATCH] CDC #27 - Updating README.md with basic instructions --- README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 049070d..b5c78dd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # FuzzyDates -Short description and motivation. +Fuzzy Dates is designed to store date values within a specified amount of accuracy. Each date is stored as a range and a descriptor, so that programmatic operations can still be performed, while providing a user-friendly label. ## Installation Add this line to your application's Gemfile: @@ -19,7 +19,21 @@ $ gem install fuzzy_dates ``` ## Usage -How to use my plugin. + +```ruby +class MyModel < ApplicationRecord + include FuzzyDates::FuzzyDateable + + has_fuzzy_dates :start_date, :end_date +end +``` + +```ruby +class MyModelsSerializer < BaseSerializer + index_attributes :id, :name, start_date: FuzzyDates::FuzzyDateSerializer, end_date: FuzzyDates::FuzzyDateSerializer + show_attributes :id, :name, start_date: FuzzyDates::FuzzyDateSerializer, end_date: FuzzyDates::FuzzyDateSerializer +end +``` ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).