class RubyAem::Resources::ConfigProperty

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

Public Class Methods

new(client, name, type, value) click to toggle source

Initialise a config property

@param client RubyAem::Client @param name the property's name @param type the property's type, e.g. Boolean @param value the property's value, e.g. true @return new RubyAem::Resources::ConfigProperty instance

# 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

Public Instance Methods

create(config_node_name) click to toggle source

Create a new config property.

@param config_node_name the node name of a given OSGI config @return RubyAem::Result

# 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