Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpierce authored and jeremyf committed Feb 8, 2024
1 parent 5a27ecc commit 5f1b3cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions app/forms/hyrax/forms.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hyrax
module Forms
##
Expand All @@ -8,7 +10,7 @@ module Forms
# self.required_fields = [:title, :creator, :rights_statement]
# # other WorkForm-like configuration here
# end
def self.PcdmObjectForm(work_class)
def self.PcdmObjectForm(work_class) # rubocop:disable Naming/MethodName
Class.new(Hyrax::Forms::PcdmObjectForm) do
self.model_class = work_class

Expand All @@ -25,7 +27,7 @@ def self.inspect
# @api public
#
# Returns the form class associated with a given model.
def self.ResourceForm(model_class) # rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity
def self.ResourceForm(model_class) # rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity, Naming/MethodName
@resource_forms ||= {}.compare_by_identity
@resource_forms[model_class] ||=
# +#respond_to?+ needs to be used here, not +#try+, because Dry::Types
Expand All @@ -47,4 +49,4 @@ def self.ResourceForm(model_class) # rubocop:disable Metrics/MethodLength, Metri
end
end
end
end
end
8 changes: 5 additions & 3 deletions app/indexers/hyrax/indexers.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Hyrax
module Indexers
##
Expand All @@ -6,7 +8,7 @@ module Indexers
#
# The base Hyrax engine could get on without this, but it’s useful for
# downstream applications and reflects what we do for forms.
def self.PcdmObjectIndexer(work_class)
def self.PcdmObjectIndexer(work_class) # rubocop:disable Naming/MethodName
Class.new(Hyrax::Indexers::PcdmObjectIndexer) do
@model_class = work_class

Expand All @@ -27,7 +29,7 @@ def inspect
# @api public
#
# Returns the indexer class associated with a given model.
def self.ResourceIndexer(model_class) # rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity
def self.ResourceIndexer(model_class) # rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity, Naming/MethodName
@resource_indexers ||= {}.compare_by_identity
@resource_indexers[model_class] ||=
# +#respond_to?+ needs to be used here, not +#try+, because Dry::Types
Expand All @@ -49,4 +51,4 @@ def self.ResourceIndexer(model_class) # rubocop:disable Metrics/MethodLength, Me
end
end
end
end
end

0 comments on commit 5f1b3cd

Please sign in to comment.