Class: Lutaml::Model::Organization

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/model/organization.rb

Overview

Stores the format-agnostic declaration that a Collection produces organized instances of a GroupClass.

Created by Collection.organizes(:name, GroupClass). Stored as class-level metadata on the Collection subclass.

Examples:

class TitleCollection < Lutaml::Model::Collection
  organizes :per_lang, PerLangTitleGroup
end

TitleCollection.organization
#=> #<Organization @name=:per_lang, @group_class=PerLangTitleGroup>

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, group_class) ⇒ Organization

Returns a new instance of Organization.

Parameters:

  • name (Symbol)

    attribute name on the Collection

  • group_class (Class)

    the GroupClass type



23
24
25
26
# File 'lib/lutaml/model/organization.rb', line 23

def initialize(name, group_class)
  @name = name
  @group_class = group_class
end

Instance Attribute Details

#group_classObject (readonly)

Returns the value of attribute group_class.



19
20
21
# File 'lib/lutaml/model/organization.rb', line 19

def group_class
  @group_class
end

#nameObject (readonly)

Returns the value of attribute name.



19
20
21
# File 'lib/lutaml/model/organization.rb', line 19

def name
  @name
end