Class: Legion::Cli::Lex::Actor

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/legion/cli/lex/actor.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



7
8
9
# File 'lib/legion/cli/lex/actor.rb', line 7

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#create(name) ⇒ Object



19
20
21
# File 'lib/legion/cli/lex/actor.rb', line 19

def create(name)
  template('templates/actor.erb', "#{lex}/lib/actors/#{name}.rb", { name: name, lex: lex, type: options[:type] })
end

#delete(name) ⇒ Object



24
25
26
27
# File 'lib/legion/cli/lex/actor.rb', line 24

def delete(name)
  remove_file("lib/legion/extensions/#{lex}/actors/#{name}.rb")
  remove_file("spec/actors/#{name}_spec.rb")
end