Module: GroupDocs::Api::Helpers::Path

Defined in:
lib/groupdocs/api/helpers/path_helper.rb

Class Method Summary collapse

Class Method Details

.append_file_name(path, name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Appends file name to path if it’s not present.



21
22
23
# File 'lib/groupdocs/api/helpers/path_helper.rb', line 21

def self.append_file_name(path, name)
  path << "/#{Object::File.basename(name)}" unless /\.(\w){3,4}$/ === path
end

.verify_starts_with_root(path) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Verifies path starts with root.

Raises:

  • (ArgumentError)

    If path does not start with /



12
13
14
# File 'lib/groupdocs/api/helpers/path_helper.rb', line 12

def self.verify_starts_with_root(path)
  path.chars.first == '/' or raise ArgumentError, "Path should start with /: #{path.inspect}"
end