-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Alma and Standard Numbers to their own modules
Remove commented out code
- Loading branch information
1 parent
919ed9d
commit a66d9df
Showing
5 changed files
with
27 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
class SolrDocument | ||
# Special alma functionality for SolrDocument | ||
module Alma | ||
def alma_record? | ||
/^[0-9]+/.match?(self['id']) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
class SolrDocument | ||
# Standard Numbers functionality for SolrDocument | ||
module StandardNumbers | ||
def standard_numbers? | ||
standard_number_fields.any? { |field| key? field } | ||
end | ||
|
||
private | ||
|
||
def standard_number_fields | ||
%w[lccn_s isbn_s issn_s oclc_s] | ||
end | ||
end | ||
end |