Sha256: dcf9c3d9990764bf70e2077600306f392a0dcc212c79ccc34bc6fb9d96035e3d

Contents?: true

Size: 992 Bytes

Versions: 27

Compression:

Stored size: 992 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"
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
bullet_train-outgoing_webhooks-1.10.0 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.9.0 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.8.5 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.8.4 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.8.3 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.8.2 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.8.1 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.8.0 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.7.23 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.7.22 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.7.21 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.7.20 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.7.19 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.7.18 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.7.17 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.7.16 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.7.15 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.7.14 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.7.13 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.7.12 lib/bullet_train/outgoing_webhooks.rb