Class: BitbucketServer::Representation::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/bitbucket_server/representation/base.rb

Direct Known Subclasses

Activity, Comment, PullRequest, Repo

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ Base

Returns a new instance of Base.


8
9
10
# File 'lib/bitbucket_server/representation/base.rb', line 8

def initialize(raw)
  @raw = raw
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw


6
7
8
# File 'lib/bitbucket_server/representation/base.rb', line 6

def raw
  @raw
end

Class Method Details

.convert_timestamp(time_usec) ⇒ Object


16
17
18
# File 'lib/bitbucket_server/representation/base.rb', line 16

def self.convert_timestamp(time_usec)
  Time.at(time_usec / 1000) if time_usec.is_a?(Integer)
end

.decorate(entries) ⇒ Object


12
13
14
# File 'lib/bitbucket_server/representation/base.rb', line 12

def self.decorate(entries)
  entries.map { |entry| new(entry)}
end