Class: Streamer::Functors::Member

Inherits:
Functor
  • Object
show all
Defined in:
lib/streamer/functors/member.rb

Overview

Member determines if the properties provided are members of the facts

Instance Attribute Summary

Attributes inherited from Functor

#options, #payload

Instance Method Summary collapse

Methods inherited from Functor

#class_name, #initialize, #type_name

Constructor Details

This class inherits a constructor from Streamer::Functors::Functor

Instance Method Details

#callObject



5
6
7
# File 'lib/streamer/functors/member.rb', line 5

def call
  member
end

#memberObject



9
10
11
12
13
14
# File 'lib/streamer/functors/member.rb', line 9

def member
  values = options.fetch(:properties).map do |pk|
    value(pk.split('.'))
  end.flatten
  (values & options.fetch(:facts)).size > 0
end