Class: WorkOS::UserConsentOption
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- WorkOS::UserConsentOption
- 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
-
#choices ⇒ Object
Returns the value of attribute choices.
-
#claim ⇒ Object
Returns the value of attribute claim.
-
#label ⇒ Object
Returns the value of attribute label.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ UserConsentOption
constructor
A new instance of UserConsentOption.
Methods inherited from Types::BaseModel
Methods included from HashProvider
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
#choices ⇒ Object
Returns the value of attribute choices.
14 15 16 |
# File 'lib/workos/connect/user_consent_option.rb', line 14 def choices @choices end |
#claim ⇒ Object
Returns the value of attribute claim.
14 15 16 |
# File 'lib/workos/connect/user_consent_option.rb', line 14 def claim @claim end |
#label ⇒ Object
Returns the value of attribute label.
14 15 16 |
# File 'lib/workos/connect/user_consent_option.rb', line 14 def label @label end |
#type ⇒ Object
Returns the value of attribute type.
14 15 16 |
# File 'lib/workos/connect/user_consent_option.rb', line 14 def type @type end |