From dd937377cf4cb8cfd2c4af713347d83c67278456 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 28 Jul 2018 21:48:37 -0700 Subject: Use a class method to consolidate timestamp conversion --- lib/bitbucket_server/representation/base.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/bitbucket_server/representation/base.rb') 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 -- cgit v1.2.1