Sha256: 896bac94d558a208b68e58ceb12f8d26e2c18056c2541215e85585753c3d4159

Contents?: true

Size: 1.85 KB

Versions: 1

Compression:

Stored size: 1.85 KB

Contents

module WerckerAPI
  class Application
    class Data
      include Virtus.model
      attribute :branch,     String
      attribute :commitHash, String
      attribute :message,    String
      attribute :scm,        SCM

      def commit_hash
        commitHash
      end
    end
    class PipelineItem
      include Virtus.model

      attribute :targetName,  String
      attribute :pipelineId,  String
      attribute :restricted,  Boolean
      attribute :totalSteps,  Integer
      attribute :currentStep, Integer
      attribute :stepName,    String
      attribute :runId,       String

      def step_name
        stepName
      end

      def run_id
        runId
      end

      def pipeline_id
        pipelineId
      end

      def total_steps
        totalSteps
      end

      def current_step
        currentStep
      end
    end

    class Item
      include Virtus.model

      attribute :data,      PipelineItem
      attribute :id,        String
      attribute :progress,  Integer
      attribute :result,    String
      attribute :status,    String
      attribute :type,      String
      attribute :updatedAt, Time

      def updated_at
        updatedAt
      end
    end

    class Workflow
      INDEX = -> (version) { "/api/#{version}/workflows" }
      SHOW = -> (version, workflow_id) { "/api/#{version}/workflows/#{workflow_id}" }

      include Virtus.model

      attribute :id,          String
      attribute :url,         String
      attribute :theme,       String
      attribute :trigger,     String
      attribute :application, Application
      attribute :createdAt,   Time
      attribute :updatedAt,   Time
      attribute :startedAt,   Time
      attribute :privacy,     Boolean
      attribute :stack,       Integer
      attribute :data,        Data
      attribute :items,       Array[Item]
      attribute :user,        User
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wercker_api-0.1.10 lib/wercker_api/application/workflow.rb