class Netdocuments::Node

Attributes

extension[R]
folder_path[R]
id[R]
name[R]
parent[R]

Public Class Methods

new(opts = {}) click to toggle source
# File lib/netdocuments/node.rb, line 7
def initialize(opts = {})
  validate_config!
  @name = opts[:name]
  @id = opts[:id]
  @extension = opts[:extension]
  @parent = opts[:parent]
  @folder_path = opts[:folder_path]
end

Public Instance Methods

update() click to toggle source
# File lib/netdocuments/node.rb, line 16
def update
  # Netdocuments.logger.info "Updating #{name} with file path as #{folder_path}"
  if extension == 'ndfld'
    q1  = {'customAttributes' => [{"id" => Netdocuments.configuration.folder_path_id,"value" => Netdocuments::PathFormatter.new(folder_path).format}]}
    Netdocuments::Folder.new(id: id).update_info({query: q1.to_json})
  else
    q1  = {'customAttributes' => [{"id" => Netdocuments.configuration.folder_path_id,"value" => Netdocuments::PathFormatter.new(folder_path).format}]}
    Netdocuments::Document.new(id: id).update_info({query: q1.to_json})
  end
end