Class: OKF::TUI::Workspace::Group
- Inherits:
-
Object
- Object
- OKF::TUI::Workspace::Group
- 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
-
#bundles ⇒ Object
readonly
Returns the value of attribute bundles.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#members ⇒ Object
readonly
Returns the value of attribute members.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
Instance Method Summary collapse
-
#cyclic? ⇒ Boolean
A hand-edited registry can name a cycle, which okf reports by declining to resolve rather than by looping.
-
#initialize(slug:, members:, bundles:, cyclic:, link: nil) ⇒ Group
constructor
A new instance of Group.
-
#linked? ⇒ Boolean
A group an okf registry link brought in — the link's own set, or one the linked file curates.
- #size ⇒ Object
Constructor Details
#initialize(slug:, members:, bundles:, cyclic:, link: nil) ⇒ Group
Returns a new instance of Group.
65 66 67 68 69 70 71 |
# File 'lib/okf/tui/workspace.rb', line 65 def initialize(slug:, members:, bundles:, cyclic:, link: nil) @slug = slug @members = members @bundles = bundles @cyclic = cyclic @link = link end |
Instance Attribute Details
#bundles ⇒ Object (readonly)
Returns the value of attribute bundles.
63 64 65 |
# File 'lib/okf/tui/workspace.rb', line 63 def bundles @bundles end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
63 64 65 |
# File 'lib/okf/tui/workspace.rb', line 63 def link @link end |
#members ⇒ Object (readonly)
Returns the value of attribute members.
63 64 65 |
# File 'lib/okf/tui/workspace.rb', line 63 def members @members end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
63 64 65 |
# File 'lib/okf/tui/workspace.rb', line 63 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.
84 85 86 |
# File 'lib/okf/tui/workspace.rb', line 84 def cyclic? @cyclic end |
#linked? ⇒ Boolean
A group an okf registry link brought in — the link's own set, or one the linked file curates. Scopable and searchable like any other; writable by nobody here, since okf persists only the groups this registry owns.
76 77 78 |
# File 'lib/okf/tui/workspace.rb', line 76 def linked? !@link.nil? end |
#size ⇒ Object
88 89 90 |
# File 'lib/okf/tui/workspace.rb', line 88 def size bundles.length end |