Conversation
test/coupon_code_test.rb
Outdated
There was a problem hiding this comment.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
lib/coupon_code.rb
Outdated
There was a problem hiding this comment.
Unnecessary spacing detected.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
|
Thanks for contributing @gee-forr. Sorry for being late. I've been sick for the last couple days 😢 As you pointed out, I agree that those However I'd prefer to leave current interface as it is because changing The end result will look like: CouponCode.configure do |c|
c.parts = 5
c.length = 6
c.separator = '-'
endI believe this approach will provide with more convenient use cases. You can find working in progress code at #6. Please feel free to create another PR for other implementation suggestions. |
|
I updated README to make that multi-part validation clearer for now: 0d40bb4. Thanks again for your time and effort and my apology for being late 😭 I will be adding configuration as soon as possible. |
Hi there,
I came across an issue where I couldn't validate codes longer than 3 parts. Turns out, it wasnt documented, and I just needed to add the parts as a second positional argument.
This however is inconsistent with the interface for the generate method.
I've updated the validate method's arguments to match those of generates, and have also added a feature to set a default parts length.
I've also updated the readme (but only in english, I don't speak Korean unfortunately), and bumped the version.
I hope you find the changes to your liking :) Thanks again.