Class: Stax::SubCommand

Inherits:
Base
  • Object
show all
Defined in:
lib/stax/subcommand.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.stax_info(*tasks) ⇒ Object



5
6
7
8
# File 'lib/stax/subcommand.rb', line 5

def stax_info(*tasks)
  @stax_info_tasks ||= []
  @stax_info_tasks += tasks
end

.stax_info_tasksObject



10
11
12
# File 'lib/stax/subcommand.rb', line 10

def stax_info_tasks
  @stax_info_tasks&.uniq
end

Instance Method Details

#infoObject



23
24
25
26
27
28
29
30
31
32
# File 'lib/stax/subcommand.rb', line 23

def info
  self.class.stax_info_tasks&.each do |task|
    begin
      invoke task
      puts "\n"
    rescue NoMethodError => e
      warn(e.message)
    end
  end
end