class Mushy::GlobalVariables

Attributes

state[RW]

Public Class Methods

details() click to toggle source
# File lib/mushy/fluxs/global_variables.rb, line 7
def self.details
  {
    name: 'GlobalVariables',
    description: 'Add global variables.',
    config: {
      values: {
                description: 'Provide key/value pairs that will be set as global variables.',
                label:       'Variables',
                type:        'keyvalue',
                value:       {},
              },
    },
  }
end
new() click to toggle source
Calls superclass method Mushy::Flux::new
# File lib/mushy/fluxs/global_variables.rb, line 22
def initialize
  super
  self.state = SymbolizedHash.new
end

Public Instance Methods

adjust_data(data) click to toggle source
# File lib/mushy/fluxs/global_variables.rb, line 27
def adjust_data data
  state.merge data
end
process(event, config) click to toggle source
# File lib/mushy/fluxs/global_variables.rb, line 31
def process event, config
  values = config[:values] || SymbolizedHash.new
  state.merge! values
  event
end