Class: Flagsmith::Engine::Identities::Trait
- Inherits:
-
Object
- Object
- Flagsmith::Engine::Identities::Trait
- Defined in:
- lib/flagsmith/engine/identities/models.rb
Overview
TraitModel
Instance Attribute Summary collapse
-
#trait_key ⇒ Object
(also: #key)
readonly
Returns the value of attribute trait_key.
-
#trait_value ⇒ Object
(also: #value)
readonly
Returns the value of attribute trait_value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(trait_key:, trait_value:) ⇒ Trait
constructor
A new instance of Trait.
Constructor Details
#initialize(trait_key:, trait_value:) ⇒ Trait
Returns a new instance of Trait.
62 63 64 65 |
# File 'lib/flagsmith/engine/identities/models.rb', line 62 def initialize(trait_key:, trait_value:) @trait_key = trait_key @trait_value = trait_value end |
Instance Attribute Details
#trait_key ⇒ Object (readonly) Also known as: key
Returns the value of attribute trait_key.
60 61 62 |
# File 'lib/flagsmith/engine/identities/models.rb', line 60 def trait_key @trait_key end |
#trait_value ⇒ Object (readonly) Also known as: value
Returns the value of attribute trait_value.
60 61 62 |
# File 'lib/flagsmith/engine/identities/models.rb', line 60 def trait_value @trait_value end |
Class Method Details
.build(json) ⇒ Object
71 72 73 |
# File 'lib/flagsmith/engine/identities/models.rb', line 71 def build(json) new(**json.slice(:trait_key, :trait_value)) end |