class ContextExposer::Integrations::KeyFilter
Attributes
keys[R]
options[R]
Public Class Methods
new(keys, options = {})
click to toggle source
# File lib/context_exposer/integrations/key_filter.rb, line 6 def initialize keys, options = {} @keys = keys || [] @options = options end
Public Instance Methods
except()
click to toggle source
# File lib/context_exposer/integrations/key_filter.rb, line 17 def except @except ||= symbolize_opts :except end
filter()
click to toggle source
expose all exposures exposed by decent_exposure to context
# File lib/context_exposer/integrations/key_filter.rb, line 12 def filter the_keys = keys - except only.empty? ? the_keys : the_keys.select {|k| only.include? k.to_sym } end
only()
click to toggle source
# File lib/context_exposer/integrations/key_filter.rb, line 21 def only @only ||= symbolize_opts :only end
symbolize_opts(name)
click to toggle source
# File lib/context_exposer/integrations/key_filter.rb, line 25 def symbolize_opts name (options[name.to_sym] || {}).map(&:to_sym) end