Class: Flagsmith::Engine::Feature
- Inherits:
-
Object
- Object
- Flagsmith::Engine::Feature
- Defined in:
- lib/flagsmith/engine/features/models.rb
Overview
FeatureModel
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(id:, name:, type:) ⇒ Feature
constructor
A new instance of Feature.
Constructor Details
#initialize(id:, name:, type:) ⇒ Feature
Returns a new instance of Feature.
94 95 96 97 98 |
# File 'lib/flagsmith/engine/features/models.rb', line 94 def initialize(id:, name:, type:) @id = id @name = name @type = type end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
92 93 94 |
# File 'lib/flagsmith/engine/features/models.rb', line 92 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
92 93 94 |
# File 'lib/flagsmith/engine/features/models.rb', line 92 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
92 93 94 |
# File 'lib/flagsmith/engine/features/models.rb', line 92 def type @type end |
Class Method Details
.build(json) ⇒ Object
107 108 109 |
# File 'lib/flagsmith/engine/features/models.rb', line 107 def build(json) new(**json.slice(:id, :name, :type)) end |
Instance Method Details
#==(other) ⇒ Object
100 101 102 103 104 |
# File 'lib/flagsmith/engine/features/models.rb', line 100 def ==(other) return false if other.nil? id == other.id end |