class BuildkiteGraphqlRuby::ResultsParsers::Artifact

Public Class Methods

from_response(response) click to toggle source
# File lib/buildkite_graphql_ruby/results_parsers/artifact.rb, line 4
def self.from_response(response)
  node = response['node']
  # node.keys ["id", "path", "state", "downloadURL"]
  
  new(
    id: node['id'],
    path: node['path'],
    state: node['state'],
    download_url: node['downloadURL'],
  )
end

Public Instance Methods

download() click to toggle source
# File lib/buildkite_graphql_ruby/results_parsers/artifact.rb, line 18
def download
  require 'open-uri'
  file_contents = open(self.download_url) { |f| f.read }
  file_contents
end