class CircleCI::Parallel::Build

Represents a CircleCI build.

Attributes

node_count[R]
number[R]

Public Class Methods

new(number, node_count) click to toggle source

@param number [Integer] the build number (`CIRCLE_BUILD_NUM`) @param node_count [Integer] node count of the build (`CIRCLE_NODE_TOTAL`)

# File lib/circleci/parallel/build.rb, line 11
def initialize(number, node_count)
  @number = number
  @node_count = node_count
end

Public Instance Methods

==(other) click to toggle source
# File lib/circleci/parallel/build.rb, line 16
def ==(other)
  number == other.number
end
Also aliased as: eql?
eql?(other)
Alias for: ==
hash() click to toggle source
# File lib/circleci/parallel/build.rb, line 22
def hash
  number.hash ^ node_count.hash
end
nodes() click to toggle source

@return [Array<Node>] nodes of the build

# File lib/circleci/parallel/build.rb, line 27
def nodes
  @nodes ||= Array.new(node_count) { |index| Node.new(self, index) }.freeze
end