Skip to content

Commit ba3a4a1

Browse files
author
Unai Abrisketa
committed
Fix rubocop
1 parent a700690 commit ba3a4a1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/beyond_api/ext.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ def underscore
4141
def camelize(uppercase_first_letter = true)
4242
string = self
4343
if uppercase_first_letter
44-
string = string.sub(/^[a-z\d]*/) { |match| match.capitalize }
44+
string = string.sub(/^[a-z\d]*/, &:capitalize)
4545
else
46-
string = string.sub(/^(?:(?=\b|[A-Z_])|\w)/) { |match| match.downcase }
46+
string = string.sub(/^(?:(?=\b|[A-Z_])|\w)/, &:downcase)
4747
end
4848
string.gsub(/(?:_|(\/))([a-z\d]*)/) { "#{$1}#{$2.capitalize}" }.gsub("/", "::")
4949
end

lib/beyond_api/resources/token.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class InvalidSessionError < StandardError; end
1313
def initialize(session)
1414
@session = session
1515

16-
raise InvalidSessionError.new("Invalid session") unless session.is_a? BeyondApi::Session
17-
raise InvalidSessionError.new("Session api_url cannot be nil") if session.api_url.nil?
16+
raise InvalidSessionError, "Invalid session" unless session.is_a? BeyondApi::Session
17+
raise InvalidSessionError, "Session api_url cannot be nil" if session.api_url.nil?
1818
end
1919

2020
def authorization_code(code)

0 commit comments

Comments
 (0)