class GCI::Job

Public Class Methods

define_attr_accessors(name) click to toggle source
# File lib/gci/job.rb, line 34
def self.define_attr_accessors(name)
  define_method("#{name}=") do |value|
    @attrs[name] = value
  end

  define_method(name) do
    @attrs[name]
  end
end
new(**attrs) { |self| ... } click to toggle source
# File lib/gci/job.rb, line 74
def initialize(**attrs)
  @attrs = attrs
  yield(self) if block_given?
end

Public Instance Methods

attributes() click to toggle source
# File lib/gci/job.rb, line 93
def attributes
  to_h.except(:name)
end
change(&block) click to toggle source
# File lib/gci/job.rb, line 83
def change(&block)
  self.class.new(**@attrs.deep_dup, &block)
end
stage=(value) click to toggle source
# File lib/gci/job.rb, line 79
def stage=(value)
  @attrs[:stage] = value.to_s
end
to_h() click to toggle source
# File lib/gci/job.rb, line 87
def to_h
  data = @attrs
  data[:stage] = data[:stage].to_s if data[:stage]
  data
end