Module: BulletTrain::OutgoingWebhooks
- Defined in:
- lib/bullet_train/outgoing_webhooks.rb,
lib/bullet_train/outgoing_webhooks/engine.rb,
lib/bullet_train/outgoing_webhooks/version.rb
Defined Under Namespace
Classes: Engine
Constant Summary collapse
- VERSION =
"1.8.1"
Class Method Summary collapse
- .current_parent_method ⇒ Object
- .default_for(klass, method, default_value) ⇒ Object
- .parent_association ⇒ Object
- .parent_association_id ⇒ Object
- .parent_class_specified? ⇒ Boolean
- .parent_resource ⇒ Object
Class Method Details
.current_parent_method ⇒ Object
27 28 29 |
# File 'lib/bullet_train/outgoing_webhooks.rb', line 27 def self.current_parent_method "current_#{parent_association}" end |
.default_for(klass, method, default_value) ⇒ Object
6 7 8 |
# File 'lib/bullet_train/outgoing_webhooks.rb', line 6 def self.default_for(klass, method, default_value) klass.respond_to?(method) ? klass.send(method) || default_value : default_value end |
.parent_association ⇒ Object
15 16 17 |
# File 'lib/bullet_train/outgoing_webhooks.rb', line 15 def self.parent_association parent_class.underscore.to_sym end |
.parent_association_id ⇒ Object
31 32 33 |
# File 'lib/bullet_train/outgoing_webhooks.rb', line 31 def self.parent_association_id :"#{parent_association}_id" end |
.parent_class_specified? ⇒ Boolean
23 24 25 |
# File 'lib/bullet_train/outgoing_webhooks.rb', line 23 def self.parent_class_specified? parent_class != "Team" end |
.parent_resource ⇒ Object
19 20 21 |
# File 'lib/bullet_train/outgoing_webhooks.rb', line 19 def self.parent_resource parent_class.underscore.pluralize.to_sym end |