Sha256: dcf9c3d9990764bf70e2077600306f392a0dcc212c79ccc34bc6fb9d96035e3d

Contents?: true

Size: 992 Bytes

Versions: 40

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

40 entries across 40 versions & 1 rubygems

Version Path
bullet_train-outgoing_webhooks-1.17.1 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.17.0 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.16.0 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.15.0 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.14.2 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.14.1 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.14.0 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.13.0 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.12.3 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.12.2 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.12.1 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.12.0 lib/bullet_train/outgoing_webhooks.rb
bullet_train-outgoing_webhooks-1.11.0 lib/bullet_train/outgoing_webhooks.rb
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