Class: WorkOS::FeatureFlag

Inherits:
Types::BaseModel show all
Defined in:
lib/workos/feature_flags/feature_flag.rb

Constant Summary collapse

HASH_ATTRS =
{
  object: :object,
  id: :id,
  slug: :slug,
  name: :name,
  description: :description,
  owner: :owner,
  tags: :tags,
  enabled: :enabled,
  default_value: :default_value,
  created_at: :created_at,
  updated_at: :updated_at
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

normalize

Methods included from HashProvider

#inspect, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ FeatureFlag

Returns a new instance of FeatureFlag.



34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/workos/feature_flags/feature_flag.rb', line 34

def initialize(json)
  hash = self.class.normalize(json)
  @object = hash[:object]
  @id = hash[:id]
  @slug = hash[:slug]
  @name = hash[:name]
  @description = hash[:description]
  @owner = hash[:owner] ? WorkOS::FeatureFlagOwner.new(hash[:owner]) : nil
  @tags = hash[:tags] || []
  @enabled = hash[:enabled]
  @default_value = hash[:default_value]
  @created_at = hash[:created_at]
  @updated_at = hash[:updated_at]
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



21
22
23
# File 'lib/workos/feature_flags/feature_flag.rb', line 21

def created_at
  @created_at
end

#default_valueObject

Returns the value of attribute default_value.



21
22
23
# File 'lib/workos/feature_flags/feature_flag.rb', line 21

def default_value
  @default_value
end

#descriptionObject

Returns the value of attribute description.



21
22
23
# File 'lib/workos/feature_flags/feature_flag.rb', line 21

def description
  @description
end

#enabledObject

Returns the value of attribute enabled.



21
22
23
# File 'lib/workos/feature_flags/feature_flag.rb', line 21

def enabled
  @enabled
end

#idObject

Returns the value of attribute id.



21
22
23
# File 'lib/workos/feature_flags/feature_flag.rb', line 21

def id
  @id
end

#nameObject

Returns the value of attribute name.



21
22
23
# File 'lib/workos/feature_flags/feature_flag.rb', line 21

def name
  @name
end

#objectObject

Returns the value of attribute object.



21
22
23
# File 'lib/workos/feature_flags/feature_flag.rb', line 21

def object
  @object
end

#ownerObject

Returns the value of attribute owner.



21
22
23
# File 'lib/workos/feature_flags/feature_flag.rb', line 21

def owner
  @owner
end

#slugObject

Returns the value of attribute slug.



21
22
23
# File 'lib/workos/feature_flags/feature_flag.rb', line 21

def slug
  @slug
end

#tagsObject

Returns the value of attribute tags.



21
22
23
# File 'lib/workos/feature_flags/feature_flag.rb', line 21

def tags
  @tags
end

#updated_atObject

Returns the value of attribute updated_at.



21
22
23
# File 'lib/workos/feature_flags/feature_flag.rb', line 21

def updated_at
  @updated_at
end