mirror of
https://github.com/nishiki/manage-password.git
synced 2025-02-20 01:50:04 +00:00
replace if not by unless
This commit is contained in:
parent
178d0e6d1d
commit
e71f8e2acf
1 changed files with 4 additions and 7 deletions
|
@ -234,13 +234,10 @@ class MPW
|
|||
# Add a new item
|
||||
# @args: item -> Object MPW::Item
|
||||
def add(item)
|
||||
if not item.instance_of?(Item)
|
||||
raise I18n.t('error.bad_class')
|
||||
elsif item.empty?
|
||||
raise I18n.t('error.empty')
|
||||
else
|
||||
@data.push(item)
|
||||
end
|
||||
raise I18n.t('error.bad_class') unless item.instance_of?(Item)
|
||||
raise I18n.t('error.empty') if item.empty?
|
||||
|
||||
return @data.push(item)
|
||||
end
|
||||
|
||||
# Search in some csv data
|
||||
|
|
Loading…
Add table
Reference in a new issue