Class: Flagsmith::Engine::Feature

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

Overview

FeatureModel

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, type:) ⇒ Feature

Returns a new instance of Feature.



96
97
98
99
100
# File 'lib/flagsmith/engine/features/models.rb', line 96

def initialize(id:, name:, type:)
  @id = id
  @name = name
  @type = type
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



94
95
96
# File 'lib/flagsmith/engine/features/models.rb', line 94

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



94
95
96
# File 'lib/flagsmith/engine/features/models.rb', line 94

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



94
95
96
# File 'lib/flagsmith/engine/features/models.rb', line 94

def type
  @type
end

Class Method Details

.build(json) ⇒ Object



109
110
111
# File 'lib/flagsmith/engine/features/models.rb', line 109

def build(json)
  new(**json.slice(:id, :name, :type))
end

Instance Method Details

#==(other) ⇒ Object



102
103
104
105
106
# File 'lib/flagsmith/engine/features/models.rb', line 102

def ==(other)
  return false if other.nil?

  id == other.id
end