diff options
author | Stan Hu <stanhu@gmail.com> | 2018-07-28 21:48:37 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-07-28 21:48:37 -0700 |
commit | dd937377cf4cb8cfd2c4af713347d83c67278456 (patch) | |
tree | 13853af9a2be020cd36a49804311aa5c1c505b34 /lib/bitbucket_server/representation/base.rb | |
parent | ae6b48d20fe559a354ffd27bb07e4e09be2382da (diff) | |
download | gitlab-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.rb | 4 |
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 |