Module: Origin::Mergeable

Included in:
Queryable
Defined in:
lib/origin/mergeable.rb

Overview

Contains behaviour for merging existing selection with new selection.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#strategyObject

Returns the value of attribute strategy.



8
9
10
# File 'lib/origin/mergeable.rb', line 8

def strategy
  @strategy
end

#strategy The name of the current strategy.(Thenameofthecurrentstrategy.) ⇒ Object



8
# File 'lib/origin/mergeable.rb', line 8

attr_accessor :strategy

Instance Method Details

#intersectMergeable

Instruct the next mergeable call to use intersection.

Examples:

Use intersection on the next call.

mergeable.intersect.in(field: [ 1, 2, 3 ])

Returns:

  • (Mergeable)

    The intersect flagged mergeable.

Since:

  • 1.0.0



18
19
20
# File 'lib/origin/mergeable.rb', line 18

def intersect
  use(:__intersect__)
end

#overrideMergeable

Instruct the next mergeable call to use override.

Examples:

Use override on the next call.

mergeable.override.in(field: [ 1, 2, 3 ])

Returns:

  • (Mergeable)

    The override flagged mergeable.

Since:

  • 1.0.0



30
31
32
# File 'lib/origin/mergeable.rb', line 30

def override
  use(:__override__)
end

#reset_strategies!nil

Reset the stratgies to nil, used after cloning.

Examples:

Reset the strategies.

mergeable.reset_strategies!

Returns:

  • (nil)

    nil.

Since:

  • 1.0.0



54
55
56
# File 'lib/origin/mergeable.rb', line 54

def reset_strategies!
  self.strategy, self.negating = nil, nil
end

#unionMergeable

Instruct the next mergeable call to use union.

Examples:

Use union on the next call.

mergeable.union.in(field: [ 1, 2, 3 ])

Returns:

  • (Mergeable)

    The union flagged mergeable.

Since:

  • 1.0.0



42
43
44
# File 'lib/origin/mergeable.rb', line 42

def union
  use(:__union__)
end