Class: SplitIoClient::PartOfSetMatcher

Inherits:
SetMatcher
  • Object
show all
Defined in:
lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb

Constant Summary collapse

MATCHER_TYPE =
'PART_OF_SET'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute, remote_array) ⇒ PartOfSetMatcher

Returns a new instance of PartOfSetMatcher.



7
8
9
# File 'lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb', line 7

def initialize(attribute, remote_array)
  super(attribute, remote_array)
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



5
6
7
# File 'lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb', line 5

def attribute
  @attribute
end

Instance Method Details

#match?(args) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
# File 'lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb', line 11

def match?(args)
  @local_set = local_set(args[:attributes], @attribute)

  return false if @local_set.empty?

  @local_set.subset? @remote_set
end

#string_type?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb', line 19

def string_type?
  false
end