Class: RubyAem::Resources::ConfigProperty

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

Overview

ConfigProperty class contains API calls related to managing an AEM config property.

Instance Method Summary collapse

Constructor Details

#initialize(client, name, type, value) ⇒ Object

Initialise a config property

Parameters:

  • client

    RubyAem::Client

  • name

    the property’s name

  • type

    the property’s type, e.g. Boolean

  • value

    the property’s value, e.g. true



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/ruby_aem/resources/config_property.rb', line 27

def initialize(client, name, type, value)
  @client = client
  @call_params = {
    name: name,
    type: type,
    value: value,
    query_params: {}
  }
  @call_params[:query_params][@call_params[:name]] = @call_params[:value]
  @call_params[:query_params]["#{@call_params[:name]}@TypeHint"] = @call_params[:type]
end

Instance Method Details

#create(config_node_name) ⇒ Object

Create a new config property.

Parameters:

  • config_node_name

    the node name of a given OSGI config

Returns:

  • RubyAem::Result



43
44
45
46
# File 'lib/ruby_aem/resources/config_property.rb', line 43

def create(config_node_name)
  @call_params[:config_node_name] = config_node_name
  @client.call(self.class, __callee__.to_s, @call_params)
end