diff --git a/lib/instapaper/client.rb b/lib/instapaper/client.rb index 20e3383..0626ae2 100644 --- a/lib/instapaper/client.rb +++ b/lib/instapaper/client.rb @@ -16,10 +16,10 @@ module Instapaper # @param options [Hash] # @return [Instapaper::Client] def initialize(options = {}) - options.each do |key, value| - instance_variable_set("@#{key}", value) - end - yield(self) if block_given? + options.each do |key, value| + instance_variable_set("@#{key}", value) + end + yield(self) if block_given? end # @return [String] diff --git a/lib/instapaper/error.rb b/lib/instapaper/error.rb index ebd797d..bddcce2 100644 --- a/lib/instapaper/error.rb +++ b/lib/instapaper/error.rb @@ -44,7 +44,7 @@ module Instapaper BOOKMARK_ERRORS, FOLDER_ERRORS, HIGHLIGHT_ERRORS, - ].collect { |e| e.keys }.flatten + ].collect(&:keys).flatten # Create a new error from an HTTP response # diff --git a/lib/instapaper/http/request.rb b/lib/instapaper/http/request.rb index c287693..1e7f3b6 100644 --- a/lib/instapaper/http/request.rb +++ b/lib/instapaper/http/request.rb @@ -49,9 +49,9 @@ module Instapaper end def error(code) - if Instapaper::Error::CODES.index(code.to_i) - Instapaper::Error.from_response(code, @path) - end + return unless Instapaper::Error::CODES.index(code.to_i) + + Instapaper::Error.from_response(code, @path) end def symbolize_keys!(object)