Class: SourceRoute::BlockConfigParser
- Defined in:
- lib/source_route/config.rb
Overview
END Config
Instance Attribute Summary collapse
-
#ret_params ⇒ Object
Returns the value of attribute ret_params.
Instance Method Summary collapse
-
#initialize ⇒ BlockConfigParser
constructor
A new instance of BlockConfigParser.
-
#output_format(data = nil, &block) ⇒ Object
override.
- #run(match_str = nil, &block) ⇒ Object
-
#track_params(value) ⇒ Object
Track when the value was passed into method.
Constructor Details
#initialize ⇒ BlockConfigParser
Returns a new instance of BlockConfigParser.
49 50 51 |
# File 'lib/source_route/config.rb', line 49 def initialize @ret_params = {} end |
Instance Attribute Details
#ret_params ⇒ Object
Returns the value of attribute ret_params.
47 48 49 |
# File 'lib/source_route/config.rb', line 47 def ret_params @ret_params end |
Instance Method Details
#output_format(data = nil, &block) ⇒ Object
override
84 85 86 |
# File 'lib/source_route/config.rb', line 84 def output_format(data = nil, &block) ret_params[:output_format] = block_given? ? block : data end |
#run(match_str = nil, &block) ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'lib/source_route/config.rb', line 53 def run(match_str = nil, &block) unless match_str.nil? ret_params[:defined_class] = match_str ret_params[:method_id] = match_str end instance_eval(&block) if block_given? ParamsConfigParser.run(@ret_params) end |
#track_params(value) ⇒ Object
Track when the value was passed into method
76 77 78 79 80 81 |
# File 'lib/source_route/config.rb', line 76 def track_params(value) ret_params[:track_params] = value.object_id ret_params[:show_additional_attrs] = :path ret_params[:include_local_var] = true ret_params[:event] = :call end |