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.



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

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

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



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

def email
  @email
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



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

def timestamp
  @timestamp
end

Instance Method Details

#dateObject



160
161
162
163
164
# File 'lib/datadog/ci/ext/environment/providers/local_git.rb', line 160

def date
  return nil if timestamp.nil?

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