Class: OKF::TUI::Workspace::Entry
- Inherits:
-
Object
- Object
- OKF::TUI::Workspace::Entry
- Defined in:
- lib/okf/tui/workspace.rb
Overview
One bundle in the workspace. model is nil when the directory is missing
or unreadable, and error says which — so a row explains itself instead of
silently vanishing from the list.
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#error ⇒ Object
Returns the value of attribute error.
-
#model ⇒ Object
Returns the value of attribute model.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
Instance Method Summary collapse
- #concepts ⇒ Object
- #default? ⇒ Boolean
-
#initialize(slug:, dir:, default:, registered:) ⇒ Entry
constructor
A new instance of Entry.
- #loaded? ⇒ Boolean
- #registered? ⇒ Boolean
Constructor Details
#initialize(slug:, dir:, default:, registered:) ⇒ Entry
Returns a new instance of Entry.
22 23 24 25 26 27 |
# File 'lib/okf/tui/workspace.rb', line 22 def initialize(slug:, dir:, default:, registered:) @slug = slug @dir = dir @default = default @registered = registered end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
19 20 21 |
# File 'lib/okf/tui/workspace.rb', line 19 def dir @dir end |
#error ⇒ Object
Returns the value of attribute error.
20 21 22 |
# File 'lib/okf/tui/workspace.rb', line 20 def error @error end |
#model ⇒ Object
Returns the value of attribute model.
20 21 22 |
# File 'lib/okf/tui/workspace.rb', line 20 def model @model end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
19 20 21 |
# File 'lib/okf/tui/workspace.rb', line 19 def slug @slug end |
Instance Method Details
#concepts ⇒ Object
41 42 43 |
# File 'lib/okf/tui/workspace.rb', line 41 def concepts loaded? ? model.concept_count : 0 end |
#default? ⇒ Boolean
29 30 31 |
# File 'lib/okf/tui/workspace.rb', line 29 def default? @default end |
#loaded? ⇒ Boolean
37 38 39 |
# File 'lib/okf/tui/workspace.rb', line 37 def loaded? !model.nil? end |
#registered? ⇒ Boolean
33 34 35 |
# File 'lib/okf/tui/workspace.rb', line 33 def registered? @registered end |