Module: Views

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

Instance Method Summary collapse

Instance Method Details

#create_view(data) ⇒ Object

Create export.

Create an export with data.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  title: 'New configuration',
  slug: 'new-configuration',
  object_model: 'Contact',
  config_json: {}
}
@data = @cxf_user.create_export(data)


46
47
48
# File 'lib/user/config/views.rb', line 46

def create_view(data)
  @client.raw('post', '/config/views', nil, data_transform(data))
end

#get_view(id) ⇒ Object

Get export.

Get an export configuration info.

Parameters

id

(Integer) – Export configuration id.

Example

@data = @cxf_user.get_export(10)


28
29
30
# File 'lib/user/config/views.rb', line 28

def get_view(id)
  @client.raw('get', "/config/views/#{id}")
end

#get_views(options = nil) ⇒ Object

Get views.

Get a collection of views.

Parameters

options

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

First Example

@data = @cxf_user.get_views

Second Example

options = { sort: 'id' }
@data = @cxf_user.get_views(options)


16
17
18
# File 'lib/user/config/views.rb', line 16

def get_views(options = nil)
  @client.raw('get', '/config/views', options)
end

#update_view(id, data) ⇒ Object

Update export configuration.

Update an export configuration info.

Parameters

id

(Integer) – Export configuration id.

data

(Hash) – Data to be submitted.

Example

data = {
  title: 'New configuration',
  slug: 'new-configuration',
  object_model: 'Contact',
  config_json: {}
}
@data = @cxf_user.update_export(36, data)


65
66
67
# File 'lib/user/config/views.rb', line 65

def update_view(id, data)
  @client.raw('put', "/config/views/#{id}", nil, data_transform(data))
end