Class: Bard::CLI::CI::GithubActions::Job

Inherits:
Struct
  • Object
show all
Defined in:
lib/bard/ci/github_actions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#apiObject

Returns the value of attribute api

Returns:

  • (Object)

    the current value of api



106
107
108
# File 'lib/bard/ci/github_actions.rb', line 106

def api
  @api
end

#jsonObject

Returns the value of attribute json

Returns:

  • (Object)

    the current value of json



106
107
108
# File 'lib/bard/ci/github_actions.rb', line 106

def json
  @json
end

Instance Method Details

#idObject



107
108
109
# File 'lib/bard/ci/github_actions.rb', line 107

def id
  json["id"]
end

#logsObject



116
117
118
# File 'lib/bard/ci/github_actions.rb', line 116

def logs
  @logs ||= api.download_logs_by_job_id(id)
end

#time_elapsedObject



111
112
113
114
# File 'lib/bard/ci/github_actions.rb', line 111

def time_elapsed
  Time.parse(json["completed_at"]).to_i -
    Time.parse(json["started_at"]).to_i
end