Class: SourceRoute::Config
Overview
todo: Here is not good. Tried to compatible with different options but code becomes hard to maintenance
Constant Summary collapse
- DIRECT_ATTRS =
[:event, :full_feature, :debug, :output_format, :show_additional_attrs, :filename, :include_local_var, :include_instance_var, :import_return_to_call, :track_params ]
Instance Attribute Summary collapse
-
#negatives ⇒ Object
Returns the value of attribute negatives.
-
#positives ⇒ Object
Returns the value of attribute positives.
Instance Method Summary collapse
- #event_becomes_array ⇒ Object
-
#formulize ⇒ Object
mutable method.
- #has_call_and_return_event ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #symbolize_output_format ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
18 19 20 21 22 23 |
# File 'lib/source_route/config.rb', line 18 def initialize @event = [:call] @output_format = :test @positives = {} @negatives = {} end |
Instance Attribute Details
#negatives ⇒ Object
Returns the value of attribute negatives.
16 17 18 |
# File 'lib/source_route/config.rb', line 16 def negatives @negatives end |
#positives ⇒ Object
Returns the value of attribute positives.
16 17 18 |
# File 'lib/source_route/config.rb', line 16 def positives @positives end |
Instance Method Details
#event_becomes_array ⇒ Object
36 37 38 |
# File 'lib/source_route/config.rb', line 36 def event_becomes_array self.event = Array(event).map(&:to_sym) end |
#formulize ⇒ Object
mutable method
26 27 28 29 30 |
# File 'lib/source_route/config.rb', line 26 def formulize symbolize_output_format event_becomes_array self end |
#has_call_and_return_event ⇒ Object
40 41 42 |
# File 'lib/source_route/config.rb', line 40 def has_call_and_return_event event.include? :return and event.include? :call end |
#symbolize_output_format ⇒ Object
32 33 34 |
# File 'lib/source_route/config.rb', line 32 def symbolize_output_format self.output_format = output_format.to_sym if output_format.respond_to? :to_sym end |