Class: ReactorSDK::Resources::RuleComponent
- Inherits:
-
BaseResource
- Object
- BaseResource
- ReactorSDK::Resources::RuleComponent
- Defined in:
- lib/reactor_sdk/resources/rule_component.rb
Instance Attribute Summary
Attributes inherited from BaseResource
#attributes, #id, #meta, #relationships, #type
Instance Method Summary collapse
-
#created_at ⇒ String
ISO8601 timestamp when the component was created.
-
#delegate_descriptor_id ⇒ String
Identifies the extension delegate powering this component Format: “extension-package-name::component-type::component-name” Example: “core::actions::custom-code” Example: “adobe-alloy::actions::send-event”.
-
#inspect ⇒ String
Human-readable representation.
-
#name ⇒ String
Display name of the rule component.
-
#order ⇒ Integer?
Execution order of this component within the rule.
-
#parsed_settings ⇒ Hash
Returns the settings field parsed into a Ruby Hash.
-
#rule_order ⇒ Float, ...
Execution order of this component within the rule graph.
-
#settings ⇒ String
Raw settings value exactly as returned by Adobe.
-
#updated_at ⇒ String
ISO8601 timestamp when the component was last updated.
Methods inherited from BaseResource
#==, #[], attribute, #initialize, #relationship_data, #relationship_id, #relationship_ids, #to_h
Constructor Details
This class inherits a constructor from ReactorSDK::Resources::BaseResource
Instance Method Details
#created_at ⇒ String
Returns ISO8601 timestamp when the component was created.
51 |
# File 'lib/reactor_sdk/resources/rule_component.rb', line 51 attribute :created_at |
#delegate_descriptor_id ⇒ String
Returns Identifies the extension delegate powering this component Format: “extension-package-name::component-type::component-name” Example: “core::actions::custom-code” Example: “adobe-alloy::actions::send-event”.
37 |
# File 'lib/reactor_sdk/resources/rule_component.rb', line 37 attribute :delegate_descriptor_id |
#inspect ⇒ String
Returns Human-readable representation.
93 94 95 96 97 98 |
# File 'lib/reactor_sdk/resources/rule_component.rb', line 93 def inspect '#<ReactorSDK::Resources::RuleComponent ' \ "id=#{id.inspect} " \ "name=#{name.inspect} " \ "delegate=#{delegate_descriptor_id.inspect}>" end |
#name ⇒ String
Returns Display name of the rule component.
31 |
# File 'lib/reactor_sdk/resources/rule_component.rb', line 31 attribute :name |
#order ⇒ Integer?
Returns Execution order of this component within the rule.
45 |
# File 'lib/reactor_sdk/resources/rule_component.rb', line 45 attribute :order |
#parsed_settings ⇒ Hash
Returns the settings field parsed into a Ruby Hash.
This is the primary accessor for component configuration. It handles all extension types uniformly:
- Core custom code (JavaScript, HTML) stored as JSON-encoded string
- Adobe Web SDK XDM objects and data objects
- Adobe Analytics variable mappings and custom setup blocks
- Any third-party extension settings structure
The app can render this as formatted JSON for display and diffing —exactly as Adobe Launch does in its own version comparison UI.
Behaviour by input type:
- JSON-encoded string → parsed into Hash
- Already a Hash → returned as-is
- nil or blank → returns empty Hash
- Unparseable string → returns empty Hash, raw value still on settings
The raw settings value is always preserved on the settings attribute unchanged — this method never modifies the underlying data.
80 81 82 83 84 85 86 87 88 |
# File 'lib/reactor_sdk/resources/rule_component.rb', line 80 def parsed_settings raw = @attributes['settings'] return {} if raw.nil? || raw == '' return raw if raw.is_a?(Hash) JSON.parse(raw) rescue JSON::ParserError {} end |
#rule_order ⇒ Float, ...
Returns Execution order of this component within the rule graph.
48 |
# File 'lib/reactor_sdk/resources/rule_component.rb', line 48 attribute :rule_order |
#settings ⇒ String
Returns Raw settings value exactly as returned by Adobe. May be a JSON-encoded string or a plain Hash depending on the extension. Use parsed_settings for reliable Hash access.
42 |
# File 'lib/reactor_sdk/resources/rule_component.rb', line 42 attribute :settings |
#updated_at ⇒ String
Returns ISO8601 timestamp when the component was last updated.
54 |
# File 'lib/reactor_sdk/resources/rule_component.rb', line 54 attribute :updated_at |