Class: Datadog::CI::Git::User

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/ci/git/user.rb

Direct Known Subclasses

NilUser

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, email, timestamp) ⇒ User

Returns a new instance of User.



9
10
11
12
13
# File 'lib/datadog/ci/git/user.rb', line 9

def initialize(name, email, timestamp)
  @name = name
  @email = email
  @timestamp = timestamp
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



7
8
9
# File 'lib/datadog/ci/git/user.rb', line 7

def email
  @email
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/datadog/ci/git/user.rb', line 7

def name
  @name
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



7
8
9
# File 'lib/datadog/ci/git/user.rb', line 7

def timestamp
  @timestamp
end

Instance Method Details

#dateObject



15
16
17
18
19
# File 'lib/datadog/ci/git/user.rb', line 15

def date
  return nil if timestamp.nil?

  Time.at(timestamp.to_i).utc.to_datetime.iso8601
end