Class: RubyAem::Resources::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_aem/resources/path.rb

Overview

Path class contains API calls related to managing an AEM path.

Instance Method Summary collapse

Constructor Details

#initialize(client, name) ⇒ Object

Initialise a path.

Parameters:

  • client

    RubyAem::Client

  • name

    the name of the path, e.g. /etc/designs



24
25
26
27
28
29
# File 'lib/ruby_aem/resources/path.rb', line 24

def initialize(client, name)
  @client = client
  @call_params = {
    name: name
  }
end

Instance Method Details

#activate(ignore_deactivated, only_modified) ⇒ Object

Activate a path.

Parameters:

  • ignore_deactivated

    if true, then deactivated items in the path will not be activated

  • only_modified

    if true, then only modified items in the path will be activated

Returns:

  • RubyAem::Result



36
37
38
39
40
41
# File 'lib/ruby_aem/resources/path.rb', line 36

def activate(ignore_deactivated, only_modified)
  @call_params[:ignoredeactivated] = ignore_deactivated
  @call_params[:onlymodified] = only_modified

  @client.call(self.class, __callee__.to_s, @call_params)
end

#deleteObject

Delete a path.

Returns:

  • RubyAem::Result



46
47
48
49
50
51
52
# File 'lib/ruby_aem/resources/path.rb', line 46

def delete
  # The path parameter will be combined with the name parameter
  # in order to delete the full path.
  @call_params[:path] = @call_params[:name]

  @client.call(self.class, __callee__.to_s, @call_params)
end