Sha256: ec8731d80cbe3a034d9f215c75077f73d3a16e79077bc5465669674ccb1095d1

Contents?: true

Size: 1.21 KB

Versions: 4

Compression:

Stored size: 1.21 KB

Contents

require_relative 'endpoint'

module Manifestly
  module Entity
    class ChecklistRun < Endpoint
      attr_accessor :id
      attr_accessor :account_id
      attr_accessor :archive_url
      attr_accessor :checklist_id
      attr_accessor :checklist_title
      attr_accessor :completed_at
      attr_accessor :description
      attr_accessor :detailed_title
      attr_accessor :external_id
      attr_accessor :late_at
      attr_accessor :percent_completed
      attr_accessor :started_at
      attr_accessor :state
      attr_accessor :summary
      attr_accessor :tag_list
      attr_accessor :title
      attr_accessor :version
      attr_accessor :hide_steps_from_external
      attr_accessor :only_assigned_can_complete
      attr_reader :users
      attr_accessor :origin

      def self.endpoint_target
        :runs
      end

      def users=(values)
        @users = Array(values).map do |it|
          next it if it.is_a?(Integer)
          next it[:id] if it.is_a?(Hash) && it[:id]

          raise "invalid user value #{it}"
        end
      end

      def steps
        return @steps if @steps

        @steps = Manifestly::Entity::ChecklistRunStep.list(self) if id
        @steps ||= []
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
manifestly-client-1.0.4 lib/manifestly/entity/checklist_run.rb
manifestly-client-1.0.3 lib/manifestly/entity/checklist_run.rb
manifestly-client-1.0.1 lib/manifestly/entity/checklist_run.rb
manifestly-client-1.0.0 lib/manifestly/entity/checklist_run.rb