From efffdd3778fc960280c7677906ed43dae5a952b0 Mon Sep 17 00:00:00 2001 From: abcang Date: Thu, 7 Jan 2021 17:40:55 +0900 Subject: Fix rubocop config and warnings (#15503) * disable NewCops * update TargetRubyVersion * Fix Lint/MissingSuper for ActiveModelSerializers::Model * Fix Lint/MissingSuper for feed * Fix Lint/FloatComparison * Do not use instance variables --- app/services/keys/claim_service.rb | 12 +++++++----- app/services/keys/query_service.rb | 18 +++++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) (limited to 'app/services/keys') diff --git a/app/services/keys/claim_service.rb b/app/services/keys/claim_service.rb index 672119130..69568a0d1 100644 --- a/app/services/keys/claim_service.rb +++ b/app/services/keys/claim_service.rb @@ -8,11 +8,13 @@ class Keys::ClaimService < BaseService :key, :signature def initialize(account, device_id, key_attributes = {}) - @account = account - @device_id = device_id - @key_id = key_attributes[:key_id] - @key = key_attributes[:key] - @signature = key_attributes[:signature] + super( + account: account, + device_id: device_id, + key_id: key_attributes[:key_id], + key: key_attributes[:key], + signature: key_attributes[:signature], + ) end end diff --git a/app/services/keys/query_service.rb b/app/services/keys/query_service.rb index 286fbd834..ac3388bdc 100644 --- a/app/services/keys/query_service.rb +++ b/app/services/keys/query_service.rb @@ -7,8 +7,10 @@ class Keys::QueryService < BaseService attributes :account, :devices def initialize(account, devices) - @account = account - @devices = devices || [] + super( + account: account, + devices: devices || [], + ) end def find(device_id) @@ -20,11 +22,13 @@ class Keys::QueryService < BaseService attributes :device_id, :name, :identity_key, :fingerprint_key def initialize(attributes = {}) - @device_id = attributes[:device_id] - @name = attributes[:name] - @identity_key = attributes[:identity_key] - @fingerprint_key = attributes[:fingerprint_key] - @claim_url = attributes[:claim_url] + super( + device_id: attributes[:device_id], + name: attributes[:name], + identity_key: attributes[:identity_key], + fingerprint_key: attributes[:fingerprint_key], + ) + @claim_url = attributes[:claim_url] end def valid_claim_url? -- cgit