Module: Seeds

Included in:
Config
Defined in:
lib/user/config/seeds.rb

Instance Method Summary collapse

Instance Method Details

#apply_seeds(data, async: false) ⇒ Object

Seeds

Apply seeds.

Apply seeds.

Example



12
13
14
15
16
# File 'lib/user/config/seeds.rb', line 12

def apply_seeds(data, async: false)
  url = '/config/seeds'
  url = "#{url}?async" if async
  @client.raw('post', url, nil, data)
end

#get_seed_process(id, options = nil) ⇒ Object

Get seed process.

Get a seed process info.

Parameters

id

(Integer) – Seed process id.

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

First Example

@data = @cxf_user.get_seed_process(1)

Second Example

options = {
  fields: 'id, title'
}
@data = @cxf_user.get_seed_process(1, options)


52
53
54
# File 'lib/user/config/seeds.rb', line 52

def get_seed_process(id, options = nil)
  @client.raw('get', "/config/seed-processes/#{id}", options)
end

#get_seed_processes(options = nil) ⇒ Object

Get seed processes.

Get a collection of seed processes.

Parameters

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

use_post

(Boolean) – Variable to determine if the request is by ‘post’ or ‘get’ functions.

First Example

@data = @cxf_user.get_seed_processes

Second Example

options = {
  fields: 'id'
}
@data = @cxf_user.get_seed_processes(options)


33
34
35
# File 'lib/user/config/seeds.rb', line 33

def get_seed_processes(options = nil)
  @client.raw('post', '/config/seed-processes', options)
end