Class: FeatureFlagger::ModelSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/feature_flagger/model_settings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments) ⇒ ModelSettings

Returns a new instance of ModelSettings.



3
4
5
6
7
# File 'lib/feature_flagger/model_settings.rb', line 3

def initialize(arguments)
  arguments.each do |field, value|
    self.public_send("#{field}=", value)
  end
end

Instance Attribute Details

#entity_nameObject

Public: entity_name to which entity the model is targeting. Take this yaml file as example:

account:

email_marketing:
    whitelabel:
      description: a rollout
      owner: core

account_in_migration:

email_marketing:
    whitelabel:
      description: a rollout
      owner: core

class Account < ActiveRecord::Base

include FeatureFlagger::Model

feature_flagger do |config|
  config.identifier_field = :cdp_tenant_id
  config.entity_name = :account_in_migration
end


34
35
36
# File 'lib/feature_flagger/model_settings.rb', line 34

def entity_name
  @entity_name
end

#identifier_fieldObject

Public: identifier_field Refers to which field must represent the unique model id.



11
12
13
# File 'lib/feature_flagger/model_settings.rb', line 11

def identifier_field
  @identifier_field
end