Class: Schematic::CheckFlagResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/schematic/schematic_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ CheckFlagResponse

Returns a new instance of CheckFlagResponse.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/schematic/schematic_client.rb', line 12

def initialize(attrs = {})
  @value = attrs[:value] || false
  @flag_key = attrs[:flag_key] || attrs[:flag]
  @flag_id = attrs[:flag_id]
  @reason = attrs[:reason] || ""
  @rule_id = attrs[:rule_id]
  @rule_type = attrs[:rule_type]
  @company_id = attrs[:company_id]
  @user_id = attrs[:user_id]
  @entitlement = attrs[:entitlement]
  @error = attrs[:error] || attrs[:err]
  @feature_allocation = attrs[:feature_allocation]
  @feature_usage = attrs[:feature_usage]
  @feature_usage_event = attrs[:feature_usage_event]
  @feature_usage_period = attrs[:feature_usage_period]
  @feature_usage_reset_at = attrs[:feature_usage_reset_at]
end

Instance Attribute Details

#company_idObject (readonly)

Returns the value of attribute company_id.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def company_id
  @company_id
end

#entitlementObject (readonly)

Returns the value of attribute entitlement.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def entitlement
  @entitlement
end

#errorObject (readonly)

Returns the value of attribute error.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def error
  @error
end

#feature_allocationObject (readonly)

Returns the value of attribute feature_allocation.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def feature_allocation
  @feature_allocation
end

#feature_usageObject (readonly)

Returns the value of attribute feature_usage.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def feature_usage
  @feature_usage
end

#feature_usage_eventObject (readonly)

Returns the value of attribute feature_usage_event.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def feature_usage_event
  @feature_usage_event
end

#feature_usage_periodObject (readonly)

Returns the value of attribute feature_usage_period.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def feature_usage_period
  @feature_usage_period
end

#feature_usage_reset_atObject (readonly)

Returns the value of attribute feature_usage_reset_at.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def feature_usage_reset_at
  @feature_usage_reset_at
end

#flag_idObject (readonly)

Returns the value of attribute flag_id.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def flag_id
  @flag_id
end

#flag_keyObject (readonly)

Returns the value of attribute flag_key.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def flag_key
  @flag_key
end

#reasonObject (readonly)

Returns the value of attribute reason.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def reason
  @reason
end

#rule_idObject (readonly)

Returns the value of attribute rule_id.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def rule_id
  @rule_id
end

#rule_typeObject (readonly)

Returns the value of attribute rule_type.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def rule_type
  @rule_type
end

#user_idObject (readonly)

Returns the value of attribute user_id.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def user_id
  @user_id
end

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/schematic/schematic_client.rb', line 7

def value
  @value
end

Instance Method Details

#to_hObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/schematic/schematic_client.rb', line 30

def to_h
  {
    value: @value,
    flag_key: @flag_key,
    flag_id: @flag_id,
    reason: @reason,
    rule_id: @rule_id,
    rule_type: @rule_type,
    company_id: @company_id,
    user_id: @user_id,
    entitlement: @entitlement,
    error: @error,
    feature_allocation: @feature_allocation,
    feature_usage: @feature_usage,
    feature_usage_event: @feature_usage_event,
    feature_usage_period: @feature_usage_period,
    feature_usage_reset_at: @feature_usage_reset_at
  }.compact
end