Skip to content

Commit

Permalink
#75 doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Aug 18, 2024
1 parent 5a1144a commit d534e01
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/fbe/issue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

# Converts an ID of GitHub issue into a nicely formatting string.
#
# @param [Factbase::Fact] fact The fact, where to get the ID of GitHub user
# @param [Factbase::Fact] fact The fact, where to get the ID of GitHub issue
# @param [Judges::Options] options The options coming from the +judges+ tool
# @param [Hash] global The hash for global caching
# @param [Loog] logg The logging facility
Expand Down
8 changes: 7 additions & 1 deletion lib/fbe/sec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@

require_relative '../fbe'

# Converts number of seconds into text.
#
# @param [Factbase::Fact] fact The fact, where to get the number of seconds
# @param [String] prop The property in the fact, with the seconds
def Fbe.sec(fact, prop = :seconds)
s = fact.send(prop.to_s)
s = fact[prop.to_s]
raise "There is no #{prop} property" if s.nil?
s = s.first.to_i
if s < 60
format('%d seconds', s)
elsif s < 60 * 60
Expand Down

0 comments on commit d534e01

Please sign in to comment.