Class: RubyAem::Resources::Bundle
- Inherits:
-
Object
- Object
- RubyAem::Resources::Bundle
- Defined in:
- lib/ruby_aem/resources/bundle.rb
Overview
Bundle class contains API calls related to managing an AEM bundle.
Instance Method Summary collapse
-
#info ⇒ Object
Retrieve bundle info.
-
#initialize(client, name) ⇒ Object
constructor
Initialise a bundle.
-
#is_active ⇒ Object
Check if this bundle state is active.
-
#start ⇒ Object
Start a bundle.
-
#stop ⇒ Object
Stop a bundle.
Constructor Details
#initialize(client, name) ⇒ Object
Initialise a bundle.
24 25 26 27 28 29 |
# File 'lib/ruby_aem/resources/bundle.rb', line 24 def initialize(client, name) @client = client @call_params = { name: name } end |
Instance Method Details
#info ⇒ Object
Retrieve bundle info.
48 49 50 |
# File 'lib/ruby_aem/resources/bundle.rb', line 48 def info @client.call(self.class, __callee__.to_s, @call_params) end |
#is_active ⇒ Object
Check if this bundle state is active. True result data indicates that the bundle is active, false otherwise.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/ruby_aem/resources/bundle.rb', line 56 def is_active result = info state = result.data.data[0].state if state == 'Active' result. = "Bundle #{@call_params[:name]} is active" result.data = true else result. = "Bundle #{@call_params[:name]} is not active. Bundle state is #{state}" result.data = false end result end |
#start ⇒ Object
Start a bundle.
34 35 36 |
# File 'lib/ruby_aem/resources/bundle.rb', line 34 def start @client.call(self.class, __callee__.to_s, @call_params) end |
#stop ⇒ Object
Stop a bundle.
41 42 43 |
# File 'lib/ruby_aem/resources/bundle.rb', line 41 def stop @client.call(self.class, __callee__.to_s, @call_params) end |