Skip to content

Commit 2fa42d2

Browse files
Add docstrings to public class methods
1 parent 6c58aa6 commit 2fa42d2

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

app/models/detector/ml_citation.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,41 @@ def self.record(term)
5454
nil
5555
end
5656

57+
# lambda_path reads and returns the value of one environment variable.
58+
#
59+
# @note This is a public class method because the entire class ends up getting called in both class and instance
60+
# contexts, due to how detectors are built. The ideal state would be a private method, but that would require
61+
# changing how the class calls itself via the fetch method.
62+
#
63+
# @see Detector::MlCitation.expected_env?
64+
# @see Detector::MlCitation.fetch
65+
# @return String or nil
5766
def self.lambda_path
5867
ENV.fetch('DETECTOR_LAMBDA_PATH', nil)
5968
end
6069

70+
# lambda_secret reads and returns the value of one environment variable.
71+
#
72+
# @note This is a public class method because the entire class ends up getting called in both class and instance
73+
# contexts, due to how detectors are built. The ideal state would be a private method, but that would require
74+
# changing how the class calls itself via the fetch method.
75+
#
76+
# @see Detector::MlCitation.expected_env?
77+
# @see Detector::MlCitation.fetch
78+
# @return String or nil
6179
def self.lambda_secret
6280
ENV.fetch('DETECTOR_LAMBDA_CHALLENGE_SECRET', nil)
6381
end
6482

83+
# lambda_url reads and returns the value of one environment variable.
84+
#
85+
# @note This is a public class method because the entire class ends up getting called in both class and instance
86+
# contexts, due to how detectors are built. The ideal state would be a private method, but that would require
87+
# changing how the class calls itself via the fetch method.
88+
#
89+
# @see Detector::MlCitation.expected_env?
90+
# @see Detector::MlCitation.fetch
91+
# @return String or nil
6592
def self.lambda_url
6693
ENV.fetch('DETECTOR_LAMBDA_URL', nil)
6794
end

0 commit comments

Comments
 (0)