Skip to content

Commit 570d8f2

Browse files
committed
Fix Rubocop offenses
1 parent 19cbbaf commit 570d8f2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/enmeshed/connector.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ module Enmeshed
44
class ConnectorError < StandardError; end
55

66
class Connector
7-
API_KEY = Settings.omniauth&.nbp&.enmeshed&.connector_api_key
8-
CONNECTOR_URL = Settings.omniauth&.nbp&.enmeshed&.connector_url
7+
API_KEY = Settings.dig(:omniauth, :nbp, :enmeshed, :connector_api_key)
8+
CONNECTOR_URL = Settings.dig(:omniauth, :nbp, :enmeshed, :connector_url)
99
API_SCHEMA = JSONSchemer.openapi(YAML.safe_load_file(Rails.root.join('lib/enmeshed/api_schema.yml'), permitted_classes: [Time, Date]))
1010

1111
# @return [String] The address of the enmeshed account.

lib/enmeshed/relationship_template.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class RelationshipTemplate < Object
88
# To minimize the risk of a template expiring before submission, we set the validity to 12 hours.
99
VALIDITY_PERIOD = 12.hours
1010
# The display name of the service as shown in the enmeshed app.
11-
DISPLAY_NAME = Settings.omniauth&.nbp&.enmeshed&.display_name
11+
DISPLAY_NAME = Settings.dig(:omniauth, :nbp, :enmeshed, :display_name)
1212
# These attributes are mandatory in the app and must be provided.
1313
# See https://enmeshed.eu/integrate/attribute-values for more attributes.
1414
REQUIRED_ATTRIBUTES = %w[GivenName Surname EMailAddress AffiliationRole].freeze
@@ -117,7 +117,7 @@ def shared_attributes
117117
end
118118

119119
def relationship_attributes
120-
if Settings.omniauth&.nbp&.enmeshed&.allow_certificate_request
120+
if Settings.dig(:omniauth, :nbp, :enmeshed, :allow_certificate_request)
121121
[
122122
{
123123
'@type': 'CreateAttributeRequestItem',

spec/lib/enmeshed/relationship_template_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686

8787
get_relationship_templates_stub.to_return(body: file_fixture('enmeshed/no_relationship_templates_yet.json'))
8888

89-
allow(Settings.omniauth.nbp.enmeshed).to receive(:allow_certificate_request).and_return(true)
89+
allow(Settings).to receive(:dig).with(:omniauth, :nbp, :enmeshed, :allow_certificate_request).and_return(true)
9090
end
9191

9292
it 'returns the expected JSON' do

0 commit comments

Comments
 (0)