Class: Cline::Workspace

Inherits:
Object
  • Object
show all
Includes:
Serializable::Dir
Defined in:
lib/cline/workspace.rb

Overview

A workspace defined in a directory

Instance Attribute Summary

Attributes included from Serializable::Dir

#create, #dir

Instance Method Summary collapse

Methods included from Serializable::Dir

included, #initialize_from_dir, #subpath

Instance Method Details

#==(other) ⇒ Boolean

Equality check

Parameters:

  • other (Object)

    The other to check equality with

Returns:

  • (Boolean)

    True if objects are equal



20
21
22
23
# File 'lib/cline/workspace.rb', line 20

def ==(other)
  other.is_a?(Workspace) &&
    other.settings == settings
end

#settings(create: self.create) ⇒ WorkspaceSettings?

Get the workspace settings

Parameters:

  • create (Boolean) (defaults to: self.create)

    Should the data be created if it does not exist?

Returns:



12
13
14
# File 'lib/cline/workspace.rb', line 12

def settings(create: self.create)
  @settings ||= WorkspaceSettings.from_cline_data(dir, create:)
end