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.
28 29 30 |
# File 'app/models/spree/integration.rb', line 28 def @connection_error_message end |
Class Method Details
.icon_path ⇒ Object
37 38 39 |
# File 'app/models/spree/integration.rb', line 37 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.
33 34 35 |
# File 'app/models/spree/integration.rb', line 33 def self.integration_group nil end |
.integration_key ⇒ Object
45 46 47 |
# File 'app/models/spree/integration.rb', line 45 def self.integration_key name.demodulize.underscore end |
.integration_name ⇒ Object
41 42 43 |
# File 'app/models/spree/integration.rb', line 41 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.
61 62 63 |
# File 'app/models/spree/integration.rb', line 61 def can_connect? true end |
#key ⇒ Object
53 54 55 |
# File 'app/models/spree/integration.rb', line 53 def key self.class.integration_key end |
#name ⇒ Object
49 50 51 |
# File 'app/models/spree/integration.rb', line 49 def name self.class.integration_name end |