Class: GhettoNotes::Main

Inherits:
Object
  • Object
show all
Defined in:
lib/ghetto_notes/main.rb

Instance Method Summary collapse

Constructor Details

#initialize(subcommand, sync_dir) ⇒ Main



5
6
7
8
9
# File 'lib/ghetto_notes/main.rb', line 5

def initialize(subcommand, sync_dir)
  @subcommand = subcommand
  @sync_dir = File.expand_path(sync_dir)
  GhettoNotes.exit_with_usage unless ['install', 'sync'].include?(subcommand)
end

Instance Method Details

#runObject



11
12
13
# File 'lib/ghetto_notes/main.rb', line 11

def run
  send("#{subcommand}_subcommand")
end