Class: Intent::Commands::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/intent/commands/base.rb

Direct Known Subclasses

Intent, Inventory, Projects, Todo

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



7
8
9
10
# File 'lib/intent/commands/base.rb', line 7

def initialize
  @identity = strip_classname
  @documents = ::Intent::Core::Documents.new
end

Instance Attribute Details

#documentsObject (readonly)

Returns the value of attribute documents.



5
6
7
# File 'lib/intent/commands/base.rb', line 5

def documents
  @documents
end

#identityObject (readonly)

Returns the value of attribute identity.



4
5
6
# File 'lib/intent/commands/base.rb', line 4

def identity
  @identity
end

Instance Method Details

#generate_idObject



16
17
18
# File 'lib/intent/commands/base.rb', line 16

def generate_id
  Nanoid.generate(size: 8, alphabet: ID_ALPHABET)
end


12
13
14
# File 'lib/intent/commands/base.rb', line 12

def print_help(output)
  output.puts(File.read(help_txt_path))
end