Class: Datadog::CI::Ext::Environment::Providers::LocalGit::GitUser

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/ci/ext/environment/providers/local_git.rb

Direct Known Subclasses

NilUser

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, email, timestamp) ⇒ GitUser

Returns a new instance of GitUser.



147
148
149
150
151
# File 'lib/datadog/ci/ext/environment/providers/local_git.rb', line 147

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

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



145
146
147
# File 'lib/datadog/ci/ext/environment/providers/local_git.rb', line 145

def email
  @email
end

#nameObject (readonly)

Returns the value of attribute name.



145
146
147
# File 'lib/datadog/ci/ext/environment/providers/local_git.rb', line 145

def name
  @name
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



145
146
147
# File 'lib/datadog/ci/ext/environment/providers/local_git.rb', line 145

def timestamp
  @timestamp
end

Instance Method Details

#dateObject



153
154
155
156
157
# File 'lib/datadog/ci/ext/environment/providers/local_git.rb', line 153

def date
  return nil if timestamp.nil?

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