Method: Mushy::Format.details

Defined in:
lib/mushy/fluxs/format.rb

.detailsObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/mushy/fluxs/format.rb', line 5

def self.details
  {
    name: 'Format',
    title: 'Alter the format of an event',
    description: 'Return the event passed to it. This opens the opportunity to use the common fluxing to alter the event.',
    fluxGroup: { name: 'Flows' },
    config: {},
    examples: {
      "Simplest Example" => {
                              description: 'It only returns what is passed to it.',
                              input: {
                                       hello: 'world',
                                     },
                              config: {
                                      },
                              result: {
                                        hello: 'world',
                                      }
                            },
      "Changing The Event" => {
                                description: 'The common fluxing can still be used to alter the event.',
                                input: {
                                         things: [
                                                   { name: "Elephant", type: "Mammal" },
                                                   { name: "Alligator", type: "Reptile" },
                                                   { name: "Giraffe", type: "Mammal" }
                                                 ]
                                       },
                                config: { outgoing_split:"things",group:"type|animal_type" },
                                result: [
                                          {
                                            animal_type: [
                                                          {
                                                            name: "Elephant",
                                                            type: "Mammal"
                                                          },
                                                          {
                                                            name: "Giraffe",
                                                            type: "Mammal"
                                                          }
                                                        ]
                                          },
                                          { animal_type:[ { name:"Alligator",type:"Reptile" } ] }
                                        ]
                            },
    }
  }
end