Sha256: 6e4c578d093b099620dba531864c0eb9f044c98e8025eeee9183ab1e01d8e6d7
Contents?: true
Size: 572 Bytes
Versions: 62
Compression:
Stored size: 572 Bytes
Contents
module SplitIoClient class EqualToBooleanMatcher MATCHER_TYPE = 'EQUAL_TO_BOOLEAN'.freeze attr_reader :attribute def initialize(attribute, boolean) @attribute = attribute @boolean = boolean end def match?(args) value = args[:attributes].fetch(@attribute) do |a| args[:attributes][a.to_s] || args[:attributes][a.to_sym] end value = false if value.to_s.downcase == 'false' value = true if value.to_s.downcase == 'true' value == @boolean end def string_type? false end end end
Version data entries
62 entries across 62 versions & 1 rubygems