Class: Spree::Integration
- Inherits:
-
Object
- Object
- Spree::Integration
- Includes:
- SingleStoreResource
- Defined in:
- app/models/spree/integration.rb
Instance Attribute Summary collapse
-
#connection_error_message ⇒ String?
This attribute is used to temporarily store connection-related error messages that can be displayed to users when testing or validating integration connections.
Class Method Summary collapse
- .icon_path ⇒ Object
-
.integration_group ⇒ Object
Associates the integration to a group.
- .integration_key ⇒ Object
- .integration_name ⇒ Object
Instance Method Summary collapse
-
#can_connect? ⇒ Boolean
Checks if the integration can establish a connection.
- #key ⇒ Object
- #name ⇒ Object
Instance Attribute Details
#connection_error_message ⇒ String?
This attribute is used to temporarily store connection-related error messages that can be displayed to users when testing or validating integration connections. It is not persisted to the database and is reset on each new connection attempt.
26 27 28 |
# File 'app/models/spree/integration.rb', line 26 def @connection_error_message end |
Class Method Details
.icon_path ⇒ Object
35 36 37 |
# File 'app/models/spree/integration.rb', line 35 def self.icon_path nil end |
.integration_group ⇒ Object
Associates the integration to a group. The name here will be used as Spree.t key to display the group name. Leave blank to leave the integration ungrouped.
31 32 33 |
# File 'app/models/spree/integration.rb', line 31 def self.integration_group nil end |
.integration_key ⇒ Object
43 44 45 |
# File 'app/models/spree/integration.rb', line 43 def self.integration_key name.demodulize.underscore end |
.integration_name ⇒ Object
39 40 41 |
# File 'app/models/spree/integration.rb', line 39 def self.integration_name name.demodulize.titleize.strip end |
Instance Method Details
#can_connect? ⇒ Boolean
Checks if the integration can establish a connection. This is a base implementation that always returns true. Subclasses should override this method to implement their own connection validation logic.
59 60 61 |
# File 'app/models/spree/integration.rb', line 59 def can_connect? true end |
#key ⇒ Object
51 52 53 |
# File 'app/models/spree/integration.rb', line 51 def key self.class.integration_key end |
#name ⇒ Object
47 48 49 |
# File 'app/models/spree/integration.rb', line 47 def name self.class.integration_name end |