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
Constructor Details
#initialize ⇒ BlockConfigParser
Returns a new instance of BlockConfigParser.
46 47 48 |
# File 'lib/source_route/config.rb', line 46 def initialize @ret_params = {} end |
Instance Attribute Details
#ret_params ⇒ Object
Returns the value of attribute ret_params.
44 45 46 |
# File 'lib/source_route/config.rb', line 44 def ret_params @ret_params end |
Instance Method Details
#output_format(data = nil, &block) ⇒ Object
override
73 74 75 |
# File 'lib/source_route/config.rb', line 73 def output_format(data = nil, &block) ret_params[:output_format] = block_given? ? block : data end |
#run(match_str = nil, &block) ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/source_route/config.rb', line 50 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 |