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



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

def api
  @api
end

#jsonObject

Returns the value of attribute json

Returns:

  • (Object)

    the current value of json



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

def json
  @json
end

Instance Method Details

#idObject



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

def id
  json["id"]
end

#logsObject



126
127
128
# File 'lib/bard/ci/github_actions.rb', line 126

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

#time_elapsedObject



121
122
123
124
# File 'lib/bard/ci/github_actions.rb', line 121

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