Method: Voog::API::LayoutAssets#create_layout_asset

Defined in:
lib/voog_api/api/layout_assets.rb

#create_layout_asset(data) ⇒ Object

Create a layout asset

Parameters:

  • data (Hash)

    a customizable set of options

Options Hash (data):

  • :data (String)

    file content (used only for text-based files, e.g. .css and .js files)

  • :file (String)

    path to file location (used for binary files only)

See Also:



28
29
30
31
32
33
34
35
36
# File 'lib/voog_api/api/layout_assets.rb', line 28

def create_layout_asset(data)
  if data && data.key?(:file)
    data = data.dup
    data[:file] = Faraday::UploadIO.new(data[:file], data[:content_type])
    options = {multipart: true}
  end

  post 'layout_assets', data, (options || {})
end