Skip to content

Commit

Permalink
rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieujobin committed Oct 11, 2023
1 parent c93dc6b commit 612dff6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
11 changes: 5 additions & 6 deletions lib/apipie/dsl_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,11 @@ def _apipie_define_validators(description)
end
end

if Apipie.configuration.process_value?
@api_params ||= {}
method_params.each do |_, param|
# params processing
@api_params[param.as] = param.process_value(params[:"#{param.name}"]) if params.key?(param.name)
end
return unless Apipie.configuration.process_value?
@api_params ||= {}
method_params.each do |_, param|
# params processing
@api_params[param.as] = param.process_value(params[:"#{param.name}"]) if params.key?(param.name)
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def filter(version:, resource_id:, method_name: nil)

if method_name.present?
resources = resources.select do |resource_description|
resource_description._methods.select do |method_description_name, _|
resource_description._methods.any? do |method_description_name, _|
method_description_name == method_name
end.present?
end
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/apipie/response_description_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Validator
attr_reader :expected_type

def [](key)
return self.send(key) if self.respond_to?(key.to_s)
self.send(key) if self.respond_to?(key.to_s)
end

def initialize(expected_type, enum_values = nil, sub_properties = nil)
Expand Down Expand Up @@ -102,7 +102,7 @@ def initialize(name, expected_type, options = {}, sub_properties = [])
end

def [](key)
return self.send(key) if self.respond_to?(key.to_s)
self.send(key) if self.respond_to?(key.to_s)
end

def add_sub_property(prop_desc)
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/apipie/extractor/recorder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
end

let(:test_context) do
double(controller: controller, request: request, response: ActionDispatch::Response.new(200))
instance_double(controller: controller, request: request, response: ActionDispatch::Response.new(200))
end

let(:file) do
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'bundler/setup'

require 'simplecov'
SimpleCov.minimum_coverage 89
SimpleCov.minimum_coverage 91
SimpleCov.start

ENV["RAILS_ENV"] ||= 'test'
Expand Down

0 comments on commit 612dff6

Please sign in to comment.