Class: ReactorSDK::Resources::Extension

Inherits:
BaseResource show all
Defined in:
lib/reactor_sdk/resources/extension.rb

Instance Attribute Summary

Attributes inherited from BaseResource

#attributes, #id, #meta, #relationships, #type

Instance Method Summary collapse

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_atString

Returns ISO8601 timestamp when the extension was installed.

Returns:

  • (String)

    ISO8601 timestamp when the extension was installed



29
# File 'lib/reactor_sdk/resources/extension.rb', line 29

attribute :created_at

#delegate_descriptor_idString

Returns Identifies the extension package and version.

Returns:

  • (String)

    Identifies the extension package and version



20
# File 'lib/reactor_sdk/resources/extension.rb', line 20

attribute :delegate_descriptor_id

#inspectString

Returns Human-readable representation.

Returns:

  • (String)

    Human-readable representation



59
60
61
62
63
# File 'lib/reactor_sdk/resources/extension.rb', line 59

def inspect
  '#<ReactorSDK::Resources::Extension ' \
    "id=#{id.inspect} " \
    "delegate=#{delegate_descriptor_id.inspect}>"
end

#nameString

Returns Display name of the extension.

Returns:

  • (String)

    Display name of the extension



23
# File 'lib/reactor_sdk/resources/extension.rb', line 23

attribute :name

#parsed_settingsHash

Returns the settings field parsed into a Ruby Hash.

Extension-level settings vary by extension type. Use this for display and diffing — exactly as Adobe Launch does in its own version comparison UI.

Returns:

  • (Hash)

    Parsed settings or empty hash if nil, blank, or unparseable



46
47
48
49
50
51
52
53
54
# File 'lib/reactor_sdk/resources/extension.rb', line 46

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

#published_atString?

Returns ISO8601 timestamp when the extension was published.

Returns:

  • (String, nil)

    ISO8601 timestamp when the extension was published



35
# File 'lib/reactor_sdk/resources/extension.rb', line 35

attribute :published_at

#settingsString

Returns Raw settings value exactly as returned by Adobe.

Returns:

  • (String)

    Raw settings value exactly as returned by Adobe



26
# File 'lib/reactor_sdk/resources/extension.rb', line 26

attribute :settings

#updated_atString

Returns ISO8601 timestamp when the extension was last updated.

Returns:

  • (String)

    ISO8601 timestamp when the extension was last updated



32
# File 'lib/reactor_sdk/resources/extension.rb', line 32

attribute :updated_at