Class: SourceRoute::Wrapper::Condition
- Inherits:
-
Struct
- Object
- Struct
- SourceRoute::Wrapper::Condition
- Defined in:
- lib/source_route/wrapper.rb,
lib/source_route/wrapper.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
-
#negatives ⇒ Object
Returns the value of attribute negatives.
-
#positive ⇒ Object
Returns the value of attribute positive.
-
#result_config ⇒ Object
Returns the value of attribute result_config.
Instance Method Summary collapse
- #event(*v) ⇒ Object
- #full_feature(value = true) ⇒ Object
- #has_call_and_return_event ⇒ Object
-
#initialize(e = [:call], n = {}, p = {}, r = GenerateResult::Config.new) ⇒ Condition
constructor
A new instance of Condition.
- #output_format(data = nil, &block) ⇒ Object
Constructor Details
#initialize(e = [:call], n = {}, p = {}, r = GenerateResult::Config.new) ⇒ Condition
Returns a new instance of Condition.
15 16 17 |
# File 'lib/source_route/wrapper.rb', line 15 def initialize(e=[:call], n={}, p={}, r=GenerateResult::Config.new) super(e, n, p, r) end |
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events
14 15 16 |
# File 'lib/source_route/wrapper.rb', line 14 def events @events end |
#negatives ⇒ Object
Returns the value of attribute negatives
14 15 16 |
# File 'lib/source_route/wrapper.rb', line 14 def negatives @negatives end |
#positive ⇒ Object
Returns the value of attribute positive
14 15 16 |
# File 'lib/source_route/wrapper.rb', line 14 def positive @positive end |
#result_config ⇒ Object
Returns the value of attribute result_config
14 15 16 |
# File 'lib/source_route/wrapper.rb', line 14 def result_config @result_config end |
Instance Method Details
#event(*v) ⇒ Object
32 33 34 |
# File 'lib/source_route/wrapper.rb', line 32 def event(*v) self.events = v.map(&:to_sym) unless v == [] end |
#full_feature(value = true) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/source_route/wrapper.rb', line 44 def full_feature(value=true) return unless value self.events = [:call, :return] result_config.import_return_to_call = true result_config.include_instance_var = true result_config.include_local_var = true result_config.include_tp_self = true end |
#has_call_and_return_event ⇒ Object
40 41 42 |
# File 'lib/source_route/wrapper.rb', line 40 def has_call_and_return_event events.include? :return and events.include? :call end |
#output_format(data = nil, &block) ⇒ Object
36 37 38 |
# File 'lib/source_route/wrapper.rb', line 36 def output_format(data = nil, &block) result_config.format = block_given? ? block : data end |