Class: Mushy::ReadJson
Instance Attribute Summary
Attributes inherited from Flux
#config, #flow, #id, #masher, #parent_fluxs, #subscribed_to, #type
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Flux
#convert_this_to_an_array, #convert_to_symbolized_hash, #execute, #execute_single_event, #group_these_results, #guard, #ignore_these_results, inherited, #initialize, #join_these_results, #limit_these_results, #merge_these_results, #model_these_results, #outgoing_split_these_results, #shape_these, #sort_these_results, #standardize_these
Constructor Details
This class inherits a constructor from Mushy::Flux
Class Method Details
.details ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mushy/fluxs/read_json.rb', line 7 def self.details { name: 'ReadJson', description: 'Read JSON and output it as an event.', config: { json: { description: 'The JSON contents that will be returned as an event.', type: 'text', value: 'json', }, }, } end |
Instance Method Details
#process(event, config) ⇒ Object
21 22 23 24 |
# File 'lib/mushy/fluxs/read_json.rb', line 21 def process event, config return nil unless config[:json].to_s != '' JSON.parse config[:json] end |