Class: Lutaml::Model::Schema::Decorators::Choices

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/model/schema/decorators/choices.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Choices

Decorates a collection of choice attributes. This class is used to handle attributes that are part of a choice constraint in a JSON schema. It provides a way to access the choice attributes in a structured manner.



14
15
16
# File 'lib/lutaml/model/schema/decorators/choices.rb', line 14

def initialize(attributes)
  @attributes = attributes.values
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



8
9
10
# File 'lib/lutaml/model/schema/decorators/choices.rb', line 8

def attributes
  @attributes
end

Instance Method Details

#choice?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/lutaml/model/schema/decorators/choices.rb', line 18

def choice?
  true
end

#polymorphic?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/lutaml/model/schema/decorators/choices.rb', line 22

def polymorphic?
  false
end