Class: SourceRoute::Wrapper::Condition

Inherits:
Struct
  • Object
show all
Defined in:
lib/source_route/wrapper.rb,
lib/source_route/wrapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#eventsObject

Returns the value of attribute events

Returns:

  • (Object)

    the current value of events



11
12
13
# File 'lib/source_route/wrapper.rb', line 11

def events
  @events
end

#negativeObject

Returns the value of attribute negative

Returns:

  • (Object)

    the current value of negative



11
12
13
# File 'lib/source_route/wrapper.rb', line 11

def negative
  @negative
end

#positiveObject

Returns the value of attribute positive

Returns:

  • (Object)

    the current value of positive



11
12
13
# File 'lib/source_route/wrapper.rb', line 11

def positive
  @positive
end

#result_configObject

Returns the value of attribute result_config

Returns:

  • (Object)

    the current value of result_config



11
12
13
# File 'lib/source_route/wrapper.rb', line 11

def result_config
  @result_config
end

Instance Method Details

#event(*v) ⇒ Object



25
26
27
28
# File 'lib/source_route/wrapper.rb', line 25

def event(*v)
  # why need self? without self, the events will not really changed, why?. seems a bug in ruby
  self.events = v.map(&:to_sym) unless v == []
end

#output_format(data = nil, &block) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/source_route/wrapper.rb', line 30

def output_format(data = nil, &block)
  result_config[:output_format] = if block_given?
                                    block
                                  else
                                    data
                                  end
end

#output_include_instance_variablesObject



46
47
48
# File 'lib/source_route/wrapper.rb', line 46

def output_include_instance_variables
  result_config[:include_instance_var] = true
end

#output_include_local_variablesObject



42
43
44
# File 'lib/source_route/wrapper.rb', line 42

def output_include_local_variables
  result_config[:include_local_var] = true
end

#selected_attrs(*attr) ⇒ Object



38
39
40
# File 'lib/source_route/wrapper.rb', line 38

def selected_attrs(*attr)
  result_config[:selected_attrs] = attr
end