From ba01505a44e025ebccf05c9b0321c384ce0be3c8 Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Tue, 28 May 2024 22:14:38 +0200 Subject: [PATCH] Update readme to use symbols instead of strings --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 68c210d..f73c110 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,11 @@ Code0::License.encryption_key = private_key # create a license license = Code0::License.new( { - 'licensee' => { 'company' => 'Code0' }, # content of licensee can be as you want, it just can't be empty - 'start_date' => '2024-05-01', # when is the first date where this license is valid? - 'end_date' => '2025-05-01', # until when is the license valid? - 'restrictions' => {}, # content can be as you wish, can be used to semantically store some restrictions that are evaluated by your application - 'options' => {}, # content can be as you wish, can be used to semantically provide some options of this license + licensee: { company: 'Code0' }, # content of licensee can be as you want, it just can't be empty + start_date: '2024-05-01', # when is the first date where this license is valid? + end_date: '2025-05-01', # until when is the license valid? + restrictions: {}, # content can be as you wish, can be used to semantically store some restrictions that are evaluated by your application + options: {}, # content can be as you wish, can be used to semantically provide some options of this license } ) @@ -59,10 +59,10 @@ Code0::License.encryption_key = public_key # load the license license = Code0::License.load(File.read('license.txt')) -# exit if license is valid or outside of the valid time +# exit if license is not valid or outside of the valid time exit unless license.valid? exit unless license.in_active_time? # for example, exit if users exceed licensed amount -exit if User.count > license.restrictions['user_count'] +exit if license.restricted?(:user_count) && User.count > license.restrictions[:user_count] ```