Class: Gitlab::Ci::Build::Rules::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/gitlab/ci/build/rules.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#allow_failureObject

Returns the value of attribute allow_failure

Returns:

  • (Object)

    the current value of allow_failure


9
10
11
# File 'lib/gitlab/ci/build/rules.rb', line 9

def allow_failure
  @allow_failure
end

#start_inObject

Returns the value of attribute start_in

Returns:

  • (Object)

    the current value of start_in


9
10
11
# File 'lib/gitlab/ci/build/rules.rb', line 9

def start_in
  @start_in
end

#whenObject

Returns the value of attribute when

Returns:

  • (Object)

    the current value of when


9
10
11
# File 'lib/gitlab/ci/build/rules.rb', line 9

def when
  @when
end

Instance Method Details

#build_attributesObject


10
11
12
13
14
15
16
# File 'lib/gitlab/ci/build/rules.rb', line 10

def build_attributes
  {
    when: self.when,
    options: { start_in: start_in }.compact,
    allow_failure: allow_failure
  }.compact
end

#pass?Boolean

Returns:

  • (Boolean)

18
19
20
# File 'lib/gitlab/ci/build/rules.rb', line 18

def pass?
  self.when != 'never'
end