Skip to content

Commit b78312e

Browse files
committed
Extract constant modules into separate files for better organization
1 parent 7a4ffe0 commit b78312e

File tree

4 files changed

+54
-29
lines changed

4 files changed

+54
-29
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# frozen_string_literal: true
2+
3+
module Datadog
4+
module OpenFeature
5+
module Binding
6+
# Assignment reasons returned in ResolutionDetails
7+
module AssignmentReason
8+
TARGETING_MATCH = 'TARGETING_MATCH'
9+
SPLIT = 'SPLIT'
10+
STATIC = 'STATIC'
11+
end
12+
end
13+
end
14+
end
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# frozen_string_literal: true
2+
3+
module Datadog
4+
module OpenFeature
5+
module Binding
6+
# Condition operators for rule evaluation
7+
module ConditionOperator
8+
MATCHES = 'MATCHES'
9+
NOT_MATCHES = 'NOT_MATCHES'
10+
GTE = 'GTE'
11+
GT = 'GT'
12+
LTE = 'LTE'
13+
LT = 'LT'
14+
ONE_OF = 'ONE_OF'
15+
NOT_ONE_OF = 'NOT_ONE_OF'
16+
IS_NULL = 'IS_NULL'
17+
end
18+
end
19+
end
20+
end

lib/datadog/open_feature/binding/configuration.rb

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,12 @@
11
# frozen_string_literal: true
22

3+
require_relative 'variation_type'
4+
require_relative 'condition_operator'
5+
require_relative 'assignment_reason'
6+
37
module Datadog
48
module OpenFeature
59
module Binding
6-
# Variation types supported by UFC (Universal Flag Configuration)
7-
module VariationType
8-
STRING = 'STRING'
9-
INTEGER = 'INTEGER'
10-
NUMERIC = 'NUMERIC'
11-
BOOLEAN = 'BOOLEAN'
12-
JSON = 'JSON'
13-
end
14-
15-
# Condition operators for rule evaluation
16-
module ConditionOperator
17-
MATCHES = 'MATCHES'
18-
NOT_MATCHES = 'NOT_MATCHES'
19-
GTE = 'GTE'
20-
GT = 'GT'
21-
LTE = 'LTE'
22-
LT = 'LT'
23-
ONE_OF = 'ONE_OF'
24-
NOT_ONE_OF = 'NOT_ONE_OF'
25-
IS_NULL = 'IS_NULL'
26-
end
27-
28-
# Assignment reasons returned in ResolutionDetails
29-
module AssignmentReason
30-
TARGETING_MATCH = 'TARGETING_MATCH'
31-
SPLIT = 'SPLIT'
32-
STATIC = 'STATIC'
33-
end
34-
3510
# Represents a feature flag configuration
3611
class Flag
3712
attr_reader :key, :enabled, :variation_type, :variations, :allocations
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
module Datadog
4+
module OpenFeature
5+
module Binding
6+
# Variation types supported by UFC (Universal Flag Configuration)
7+
module VariationType
8+
STRING = 'STRING'
9+
INTEGER = 'INTEGER'
10+
NUMERIC = 'NUMERIC'
11+
BOOLEAN = 'BOOLEAN'
12+
JSON = 'JSON'
13+
end
14+
end
15+
end
16+
end

0 commit comments

Comments
 (0)