Sha256: 99e1943065943b6e6a795466357840bddb4bebee1e06d51103ffb637a00f4b9e

Contents?: true

Size: 1.31 KB

Versions: 4

Compression:

Stored size: 1.31 KB

Contents

module WerckerAPI
  class Commit
    include Virtus.model

    attribute :_id,     String
    attribute :commit,  String
    attribute :message, String
    attribute :by,      String
  end

  class Run
    INDEX   = -> (version)         { "/api/#{version}/runs" }
    SHOW    = -> (version, run_id) { "/api/#{version}/runs/#{run_id}" }
    TRIGGER = -> (version)         { "/api/#{version}/runs" }
    ABORT   = -> (version, run_id) { "/api/#{version}/runs/#{run_id}/abort" }
    STEPS   = -> (version, run_id) { "/api/#{version}/runs/#{run_id}/steps" }

    include Virtus.model

    attribute :id, String
    attribute :url, String
    attribute :branch, String
    attribute :commitHash, String
    attribute :createdAt, Time
    attribute :envVars, Array[String]
    attribute :finishedAt, Time
    attribute :message, String
    attribute :progress, Integer
    attribute :result, String
    attribute :startedAt, Time
    attribute :status, String
    attribute :pullRequest, Hash
    attribute :commits, Array[Commit]
    attribute :sourceRun, Run
    attribute :user, User
    attribute :pipeline, Pipeline

    def source_run
      sourceRun
    end

    def commit_hash
      commitHash
    end

    def created_at
      createdAt
    end

    def finished_at
      finishedAt
    end

    def env_vars
      envVars
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wercker_api-1.0.8 lib/wercker_api/run.rb
wercker_api-1.0.6 lib/wercker_api/run.rb
wercker_api-1.0.4 lib/wercker_api/run.rb
wercker_api-1.0.2 lib/wercker_api/run.rb