Class: OKF::TUI::Workspace::Group

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

Overview

One registry group (okf 1.12): a slug naming a list of members — bundle or group slugs, so they nest — which resolves recursively, path-deduped, to bundle leaves.

members is what the registry file says, verbatim, and bundles is what okf resolved it to. Both are shown, because they answer different questions: the members are what an edit would change, the leaves are what a search would cover, and for a nested group those are not the same list.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(slug:, members:, bundles:, cyclic:) ⇒ Group

Returns a new instance of Group.



57
58
59
60
61
62
# File 'lib/okf/tui/workspace.rb', line 57

def initialize(slug:, members:, bundles:, cyclic:)
  @slug = slug
  @members = members
  @bundles = bundles
  @cyclic = cyclic
end

Instance Attribute Details

#bundlesObject (readonly)

Returns the value of attribute bundles.



55
56
57
# File 'lib/okf/tui/workspace.rb', line 55

def bundles
  @bundles
end

#membersObject (readonly)

Returns the value of attribute members.



55
56
57
# File 'lib/okf/tui/workspace.rb', line 55

def members
  @members
end

#slugObject (readonly)

Returns the value of attribute slug.



55
56
57
# File 'lib/okf/tui/workspace.rb', line 55

def slug
  @slug
end

Instance Method Details

#cyclic?Boolean

A hand-edited registry can name a cycle, which okf reports by declining to resolve rather than by looping. Nothing here can repair it, so the row says so and refuses to be scoped — the alternative is a group that silently covers no bundles.

Returns:

  • (Boolean)


68
69
70
# File 'lib/okf/tui/workspace.rb', line 68

def cyclic?
  @cyclic
end

#sizeObject



72
73
74
# File 'lib/okf/tui/workspace.rb', line 72

def size
  bundles.length
end