Class: Tracing::ArgumentFilter
- Inherits:
-
BaseFilter
- Object
- BaseFilter
- Tracing::ArgumentFilter
- Defined in:
- lib/filters/simple/argument_filter.rb
Overview
filter on instance variables
Instance Attribute Summary collapse
-
#var_name ⇒ Object
Returns the value of attribute var_name.
Attributes inherited from BaseFilter
Instance Method Summary collapse
- #allow_action(msg, context) ⇒ Object
-
#initialize(options) ⇒ ArgumentFilter
constructor
A new instance of ArgumentFilter.
Methods inherited from BaseFilter
#name_allow_action, register_filters, unregister_filters
Constructor Details
#initialize(options) ⇒ ArgumentFilter
Returns a new instance of ArgumentFilter.
6 7 8 9 10 |
# File 'lib/filters/simple/argument_filter.rb', line 6 def initialize() super() @rules = [:arg_rules] || [:args_filter] || {} @var_name = [:arg_name] end |
Instance Attribute Details
#var_name ⇒ Object
Returns the value of attribute var_name.
4 5 6 |
# File 'lib/filters/simple/argument_filter.rb', line 4 def var_name @var_name end |
Instance Method Details
#allow_action(msg, context) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/filters/simple/argument_filter.rb', line 12 def allow_action(msg, context) puts "AMF" obj = context[:args] if var_name.kind_of?(Symbol) || var_name.kind_of?(String) key = var_name.to_sym if obj.has_key? key value = obj[key] return name_allow_action(value) end end :yield end |