Class: WorkOS::FlagRule

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/workos/feature_flags/flag_rule.rb

Constant Summary collapse

HASH_ATTRS =
{
  object: :object,
  id: :id,
  flag_id: :flag_id,
  flag_slug: :flag_slug,
  environment_id: :environment_id,
  target_type: :target_type,
  position: :position,
  value_type: :value_type,
  value: :value,
  created_at: :created_at,
  updated_at: :updated_at
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FlagRule

Returns a new instance of FlagRule.



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

def initialize(json)
  hash = self.class.normalize(json)
  @object = hash[:object]
  @id = hash[:id]
  @flag_id = hash[:flag_id]
  @flag_slug = hash[:flag_slug]
  @environment_id = hash[:environment_id]
  @target_type = hash[:target_type]
  @position = hash[:position]
  @value_type = hash[:value_type]
  @value = hash[:value]
  @created_at = hash[:created_at]
  @updated_at = hash[:updated_at]
end

Instance Attribute Details

#created_at ⇒ Object

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#environment_id ⇒ Object

Returns the value of attribute environment_id.



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

def environment_id
  @environment_id
end

#flag_id ⇒ Object

Returns the value of attribute flag_id.



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

def flag_id
  @flag_id
end

#flag_slug ⇒ Object

Returns the value of attribute flag_slug.



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

def flag_slug
  @flag_slug
end

#id ⇒ Object

Returns the value of attribute id.



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

def id
  @id
end

#object ⇒ Object

Returns the value of attribute object.



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

def object
  @object
end

#position ⇒ Object

Returns the value of attribute position.



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

def position
  @position
end

#target_type ⇒ Object

Returns the value of attribute target_type.



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

def target_type
  @target_type
end

#updated_at ⇒ Object

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

#value ⇒ Object

Returns the value of attribute value.



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

def value
  @value
end

#value_type ⇒ Object

Returns the value of attribute value_type.



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

def value_type
  @value_type
end