Class: RubyAem::ConfigProperty

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_aem/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



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

def initialize(client, name, type, value)
  @client = client
  @info = {
    name: name,
    type: type,
    value: value
  }
end

Instance Method Details

#create(run_mode) ⇒ Object

Create a new config property.

Parameters:

  • run_mode

    AEM run mode: author or publish

Returns:

  • RubyAem::Result



41
42
43
44
45
46
47
48
49
50
# File 'lib/ruby_aem/config_property.rb', line 41

def create(run_mode)

  name = RubyAem::Swagger.property_to_parameter(@info[:name])

  @info[:run_mode] = run_mode
  @info["#{name}".to_sym] = @info[:value]
  @info["#{name}_type_hint".to_sym] = @info[:type]

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