Class: MyManga::CLI::Command

Inherits:
Hanami::CLI::Command
  • Object
show all
Defined in:
lib/my_manga/command.rb

Overview

Base class for CLI commands

Instance Method Summary collapse

Instance Method Details

#manga_names(input) ⇒ Object



5
6
7
8
9
10
# File 'lib/my_manga/command.rb', line 5

def manga_names(input)
  all = MyManga.names
  names = Array(input.to_s.split(',')).map(&:strip)

  names.empty? ? all : all & names
end

#pad(string, width, with: ' ') ⇒ Object



12
13
14
# File 'lib/my_manga/command.rb', line 12

def pad(string, width, with: ' ')
  string.ljust(width + 2, with)
end