Class: Mushy::Document

Inherits:
Flux
  • Object
show all
Defined in:
lib/mushy/fluxs/document.rb

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

.detailsObject



2
3
4
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
# File 'lib/mushy/fluxs/document.rb', line 2

def self.details
  {
    name: 'Document',
    title: 'Make a multi-line liquid value',
    description: 'Create a multi-line document.',
    fluxGroup: { name: 'Flows' },
    config: {
      document: {
        description: 'The multi-line document you wish to create.',
        type: 'textarea',
        value: ''
      }
    },
    examples: {
      'Example' => {
        description: 'Using this Flux to build a document',
        input: {
          people: [{ name: 'John' }, { name: 'Jane' }]
        },
        config: {
          document: '{% for person in people %} {{ person.name }} {% endfor %}'
        },
        result: {
          document: ' John  Jane '
        }
      }
    }
  }
end

Instance Method Details

#process(_, config) ⇒ Object



32
33
34
35
36
# File 'lib/mushy/fluxs/document.rb', line 32

def process(_, config)
  {
    document: config[:document]
  }
end