Class: WorkOS::UserConsentOption

Inherits:
Types::BaseModel show all
Defined in:
lib/workos/connect/user_consent_option.rb

Constant Summary collapse

HASH_ATTRS =
{
  claim: :claim,
  type: :type,
  label: :label,
  choices: :choices
}.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) ⇒ UserConsentOption

Returns a new instance of UserConsentOption.



20
21
22
23
24
25
26
# File 'lib/workos/connect/user_consent_option.rb', line 20

def initialize(json)
  hash = self.class.normalize(json)
  @claim = hash[:claim]
  @type = hash[:type]
  @label = hash[:label]
  @choices = (hash[:choices] || []).map { |item| item ? WorkOS::UserConsentOptionChoice.new(item) : nil }
end

Instance Attribute Details

#choicesObject

Returns the value of attribute choices.



14
15
16
# File 'lib/workos/connect/user_consent_option.rb', line 14

def choices
  @choices
end

#claimObject

Returns the value of attribute claim.



14
15
16
# File 'lib/workos/connect/user_consent_option.rb', line 14

def claim
  @claim
end

#labelObject

Returns the value of attribute label.



14
15
16
# File 'lib/workos/connect/user_consent_option.rb', line 14

def label
  @label
end

#typeObject

Returns the value of attribute type.



14
15
16
# File 'lib/workos/connect/user_consent_option.rb', line 14

def type
  @type
end