summaryrefslogtreecommitdiff
path: root/lib/bitbucket_server/representation/base.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-07-28 21:48:37 -0700
committerStan Hu <stanhu@gmail.com>2018-07-28 21:48:37 -0700
commitdd937377cf4cb8cfd2c4af713347d83c67278456 (patch)
tree13853af9a2be020cd36a49804311aa5c1c505b34 /lib/bitbucket_server/representation/base.rb
parentae6b48d20fe559a354ffd27bb07e4e09be2382da (diff)
downloadgitlab-ce-dd937377cf4cb8cfd2c4af713347d83c67278456.tar.gz
Use a class method to consolidate timestamp conversion
Diffstat (limited to 'lib/bitbucket_server/representation/base.rb')
-rw-r--r--lib/bitbucket_server/representation/base.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bitbucket_server/representation/base.rb b/lib/bitbucket_server/representation/base.rb
index 0f3f2b60f5a..a1961bae6ef 100644
--- a/lib/bitbucket_server/representation/base.rb
+++ b/lib/bitbucket_server/representation/base.rb
@@ -12,6 +12,10 @@ module BitbucketServer
def self.decorate(entries)
entries.map { |entry| new(entry)}
end
+
+ def self.convert_timestamp(time_usec)
+ Time.at(time_usec / 1000) if time_usec.is_a?(Integer)
+ end
end
end
end