Sha256: 5d7366560383c1665bcf222cd396a054a91ba43c97a5095b3136dd2b469b977d

Contents?: true

Size: 955 Bytes

Versions: 9

Compression:

Stored size: 955 Bytes

Contents

module Vx
  module Builder
    class Task

      attr_reader :name, :src, :sha, :deploy_key, :branch, :pull_request_id,
        :cache_url_prefix, :artifacts_url_prefix, :job_id, :build_id

      def initialize(options = {})
        @name                 = options[:name]
        @src                  = options[:src]
        @sha                  = options[:sha]
        @job_id               = options[:job_id]
        @build_id             = options[:build_id]
        @deploy_key           = options[:deploy_key]
        @branch               = options[:branch]
        @pull_request_id      = options[:pull_request_id]
        @cache_url_prefix     = options[:cache_url_prefix]
        @artifacts_url_prefix = options[:artifacts_url_prefix]

        validate!
      end

      private

        def validate!
          (name && src && sha && deploy_key && branch && job_id && build_id) or
            raise(MissingKeys)
        end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vx-builder-0.1.8 lib/vx/builder/task.rb
vx-builder-0.1.7 lib/vx/builder/task.rb
vx-builder-0.1.6 lib/vx/builder/task.rb
vx-builder-0.1.5 lib/vx/builder/task.rb
vx-builder-0.1.4 lib/vx/builder/task.rb
vx-builder-0.1.3 lib/vx/builder/task.rb
vx-builder-0.1.2 lib/vx/builder/task.rb
vx-builder-0.1.1 lib/vx/builder/task.rb
vx-builder-0.1.0 lib/vx/builder/task.rb