Skip to content

Commit 1880d07

Browse files
committed
Unused argument cleanup
1 parent de0e745 commit 1880d07

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

lib/jsonapi/cached_resource_fragment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def self.fetch_fragments(resource_klass, serializer, context, cache_ids)
88

99
results = self.lookup(resource_klass, serializer_config_key, context, context_key, cache_ids)
1010

11-
miss_ids = results.select{|k,v| v.nil? }.keys
11+
miss_ids = results.select{|_k,v| v.nil? }.keys
1212
unless miss_ids.empty?
1313
find_filters = {resource_klass._primary_key => miss_ids.uniq}
1414
find_options = {context: context}

lib/jsonapi/compiled_json.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def initialize(json, h = nil)
1919
@h = h
2020
end
2121

22-
def to_json(*args)
22+
def to_json(*_args)
2323
@json
2424
end
2525

lib/jsonapi/formatter.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def unformat(formatted_key)
108108

109109
class DasherizedKeyFormatter < JSONAPI::KeyFormatter
110110
class << self
111-
def format(key)
111+
def format(_key)
112112
super.underscore.dasherize
113113
end
114114

@@ -146,7 +146,7 @@ class UnderscoredRouteFormatter < JSONAPI::RouteFormatter
146146

147147
class CamelizedRouteFormatter < JSONAPI::RouteFormatter
148148
class << self
149-
def format(route)
149+
def format(_route)
150150
super.camelize(:lower)
151151
end
152152

@@ -158,7 +158,7 @@ def unformat(formatted_route)
158158

159159
class DasherizedRouteFormatter < JSONAPI::RouteFormatter
160160
class << self
161-
def format(route)
161+
def format(_route)
162162
super.dasherize
163163
end
164164

lib/jsonapi/include_directives.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def get_related(current_path)
6565

6666
def get_includes(directive, only_joined_includes = true)
6767
ir = directive[:include_related]
68-
ir = ir.select { |k,v| v[:include_in_join] } if only_joined_includes
68+
ir = ir.select { |_k,v| v[:include_in_join] } if only_joined_includes
6969

7070
ir.map do |name, sub_directive|
7171
sub = get_includes(sub_directive, only_joined_includes)

lib/jsonapi/link_builder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def build_engine_name
6161
unless scopes.empty?
6262
"#{ scopes.first.to_s.camelize }::Engine".safe_constantize
6363
end
64-
rescue LoadError => e
64+
rescue LoadError => _e
6565
nil
6666
end
6767
end

lib/jsonapi/request_parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def error_object_overrides
2424
{}
2525
end
2626

27-
def each(response_document)
27+
def each(_response_document)
2828
operation = setup_base_op(params)
2929
if @errors.any?
3030
fail JSONAPI::Exceptions::Errors.new(@errors)
@@ -595,7 +595,7 @@ def verify_permitted_params(params, allowed_fields)
595595
end
596596
end
597597
when 'attributes'
598-
value.each do |attr_key, attr_value|
598+
value.each do |attr_key, _attr_value|
599599
unless formatted_allowed_fields.include?(attr_key.to_sym)
600600
if JSONAPI.configuration.raise_if_parameters_not_allowed
601601
param_errors.concat JSONAPI::Exceptions::ParameterNotAllowed.new(

lib/jsonapi/resource.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def _replace_to_many_links(relationship_type, relationship_key_values, options)
308308
:completed
309309
end
310310

311-
def _replace_to_one_link(relationship_type, relationship_key_value, options)
311+
def _replace_to_one_link(relationship_type, relationship_key_value, _options)
312312
relationship = self.class._relationships[relationship_type]
313313

314314
send("#{relationship.foreign_key}=", relationship_key_value)
@@ -317,7 +317,7 @@ def _replace_to_one_link(relationship_type, relationship_key_value, options)
317317
:completed
318318
end
319319

320-
def _replace_polymorphic_to_one_link(relationship_type, key_value, key_type, options)
320+
def _replace_polymorphic_to_one_link(relationship_type, key_value, key_type, _options)
321321
relationship = self.class._relationships[relationship_type.to_sym]
322322

323323
_model.public_send("#{relationship.foreign_key}=", key_value)
@@ -360,7 +360,7 @@ def _remove_to_many_link(relationship_type, key, options)
360360
fail JSONAPI::Exceptions::RecordNotFound.new(key)
361361
end
362362

363-
def _remove_to_one_link(relationship_type, options)
363+
def _remove_to_one_link(relationship_type, _options)
364364
relationship = self.class._relationships[relationship_type]
365365

366366
send("#{relationship.foreign_key}=", nil)
@@ -852,7 +852,7 @@ def caching?
852852
@caching && !JSONAPI.configuration.resource_cache.nil?
853853
end
854854

855-
def attribute_caching_context(context)
855+
def attribute_caching_context(_context)
856856
nil
857857
end
858858

lib/jsonapi/resource_serializer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def relationships_hash(source, fetchable_fields, include_directives = {})
278278

279279
include_directives[:include_related] ||= {}
280280

281-
relationships = source.class._relationships.select{|k,v| fetchable_fields.include?(k) }
281+
relationships = source.class._relationships.select{|k,_v| fetchable_fields.include?(k) }
282282
field_set = supplying_relationship_fields(source.class) & relationships.keys
283283

284284
relationships.each_with_object({}) do |(name, relationship), hash|
@@ -317,7 +317,7 @@ def cached_relationships_hash(source, include_directives)
317317
h = source.relationships || {}
318318
return h unless include_directives.has_key?(:include_related)
319319

320-
relationships = source.resource_klass._relationships.select do |k,v|
320+
relationships = source.resource_klass._relationships.select do |k,_v|
321321
source.fetchable_fields.include?(k)
322322
end
323323

0 commit comments

Comments
 (0)