Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change value validation to length > 0 #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def key=(key)
# Custom attribute writer method with validation
# @param [Object] value Value to be assigned
def value=(value)
if !value.nil? && value.to_s.length > -1
fail ArgumentError, 'invalid value for "value", the character length must be smaller than or equal to -1.'
if !value.nil? && value.to_s.length < -1
fail ArgumentError, 'invalid value for "value", the character length must be bigger than -1.'
end

@value = value
Expand Down