Sha256: b815790c207d688b74820bc2f9d73679bef0432d5eb0f1cca8cc22ba5ffe5505

Contents?: true

Size: 998 Bytes

Versions: 82

Compression:

Stored size: 998 Bytes

Contents

require "bullet_train/outgoing_webhooks/version"
require "bullet_train/outgoing_webhooks/engine"

module BulletTrain
  module OutgoingWebhooks
    def self.default_for(klass, method, default_value)
      klass.respond_to?(method) ? klass.send(method) || default_value : default_value
    end

    mattr_accessor :parent_class, default: default_for(BulletTrain, :parent_class, "Team")
    mattr_accessor :base_class, default: default_for(BulletTrain, :base_class, "ApplicationRecord")
    mattr_accessor :advanced_hostname_security, default: false
    mattr_accessor :http_verify_mode

    def self.parent_association
      parent_class.underscore.to_sym
    end

    def self.parent_resource
      parent_class.underscore.pluralize.to_sym
    end

    def self.parent_class_specified?
      parent_class != "Team"
    end

    def self.current_parent_method
      "current_#{parent_association}"
    end

    def self.parent_association_id
      "#{parent_association}_id".to_sym
    end
  end
end

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
bullet_train-outgoing_webhooks-1.6.38 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.37 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.36 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.35 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.34 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.33 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.32 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.31 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.30 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.29 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.28 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.27 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.26 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.25 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.24 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.23 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.22 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.21 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.20 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.6.19 lib/bullet_train/outgoing_webhooks.rb