Skip to content

Commit

Permalink
#3 - Removed useless controls
Browse files Browse the repository at this point in the history
  • Loading branch information
fcarrega committed Oct 19, 2020
1 parent 5f334b5 commit 89ca00e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
lemonway-ruby (1.0.5)
lemonway-ruby (1.0.6)
json (~> 2.1, >= 2.1.0)
typhoeus (~> 1.0, >= 1.0.1)

Expand Down
42 changes: 21 additions & 21 deletions lib/lemonway-ruby/models/company.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,53 +142,53 @@ def valid?
# Custom attribute writer method with validation
# @param [Object] name Value to be assigned
def name=(name)
if name.nil?
fail ArgumentError, 'name cannot be nil'
end
# if name.nil?
# fail ArgumentError, 'name cannot be nil'
# end

if name.to_s.length > 256
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 256.'
end

if name.to_s.length < 1
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
end
# if name.to_s.length < 1
# fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
# end

@name = name
end

# Custom attribute writer method with validation
# @param [Object] description Value to be assigned
def description=(description)
if description.nil?
fail ArgumentError, 'description cannot be nil'
end
# if description.nil?
# fail ArgumentError, 'description cannot be nil'
# end

if description.to_s.length > 256
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 256.'
end

if description.to_s.length < 1
fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
end
# if description.to_s.length < 1
# fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
# end

@description = description
end

# Custom attribute writer method with validation
# @param [Object] website_url Value to be assigned
def website_url=(website_url)
if website_url.nil?
fail ArgumentError, 'website_url cannot be nil'
end
# if website_url.nil?
# fail ArgumentError, 'website_url cannot be nil'
# end

if website_url.to_s.length > 256
fail ArgumentError, 'invalid value for "website_url", the character length must be smaller than or equal to 256.'
end

if website_url.to_s.length < 1
fail ArgumentError, 'invalid value for "website_url", the character length must be great than or equal to 1.'
end
# if website_url.to_s.length < 1
# fail ArgumentError, 'invalid value for "website_url", the character length must be great than or equal to 1.'
# end

@website_url = website_url
end
Expand All @@ -200,9 +200,9 @@ def identification_number=(identification_number)
fail ArgumentError, 'invalid value for "identification_number", the character length must be smaller than or equal to 256.'
end

if !identification_number.nil? && identification_number.to_s.length < 1
fail ArgumentError, 'invalid value for "identification_number", the character length must be great than or equal to 1.'
end
# if !identification_number.nil? && identification_number.to_s.length < 1
# fail ArgumentError, 'invalid value for "identification_number", the character length must be great than or equal to 1.'
# end

@identification_number = identification_number
end
Expand Down
2 changes: 1 addition & 1 deletion lib/lemonway-ruby/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
=end

module LemonWayClient
VERSION = '1.0.5'
VERSION = '1.0.6'
end

0 comments on commit 89ca00e

Please sign in to comment.