Class: Flagsmith::Engine::Organisation

Inherits:
Object
  • Object
show all
Defined in:
lib/flagsmith/engine/organisations/models.rb

Overview

OrganisationModel

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, stop_serving_flags:, persist_trait_data:, feature_analitycs: nil) ⇒ Organisation

Returns a new instance of Organisation.



9
10
11
12
13
14
15
# File 'lib/flagsmith/engine/organisations/models.rb', line 9

def initialize(id:, name:, stop_serving_flags:, persist_trait_data:, feature_analitycs: nil)
  @id = id
  @name = name
  @feature_analitycs = feature_analitycs
  @stop_serving_flags = stop_serving_flags
  @persist_trait_data = persist_trait_data
end

Instance Attribute Details

#feature_analitycsObject (readonly)

Returns the value of attribute feature_analitycs.



7
8
9
# File 'lib/flagsmith/engine/organisations/models.rb', line 7

def feature_analitycs
  @feature_analitycs
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/flagsmith/engine/organisations/models.rb', line 7

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/flagsmith/engine/organisations/models.rb', line 7

def name
  @name
end

#persist_trait_dataObject (readonly)

Returns the value of attribute persist_trait_data.



7
8
9
# File 'lib/flagsmith/engine/organisations/models.rb', line 7

def persist_trait_data
  @persist_trait_data
end

#stop_serving_flagsObject (readonly)

Returns the value of attribute stop_serving_flags.



7
8
9
# File 'lib/flagsmith/engine/organisations/models.rb', line 7

def stop_serving_flags
  @stop_serving_flags
end

Class Method Details

.build(json) ⇒ Object



22
23
24
# File 'lib/flagsmith/engine/organisations/models.rb', line 22

def build(json)
  new(**json.slice(:id, :name, :feature_analitycs, :stop_serving_flags, :persist_trait_data))
end

Instance Method Details

#unique_slugObject



17
18
19
# File 'lib/flagsmith/engine/organisations/models.rb', line 17

def unique_slug
  "#{id}-#{name}"
end