Class: OKF::Registry::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/okf/registry.rb

Overview

A named set of bundle sources: a unique slug and an ordered list of members (bundle or group slugs), stored normalized. A group has no path — it resolves, recursively, to the bundles its members name. It shares the slug namespace with Entry: a slug names one or the other, never both, so @backend is unambiguous. Only okf search/okf server consume one — the two verbs that already take several bundles.

A plain class, not a Struct like Entry: the field we want is members, and Struct.new(:slug, :members) would shadow Struct#members (the field-name introspection) — the gotcha Lint/StructNewOverride flags. This keeps group.members as the natural accessor without the override.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(slug, members) ⇒ Group

Returns a new instance of Group.



52
53
54
55
# File 'lib/okf/registry.rb', line 52

def initialize(slug, members)
  @slug = slug
  @members = members
end

Instance Attribute Details

#membersObject

Returns the value of attribute members.



50
51
52
# File 'lib/okf/registry.rb', line 50

def members
  @members
end

#slugObject

Returns the value of attribute slug.



50
51
52
# File 'lib/okf/registry.rb', line 50

def slug
  @slug
end