class AboutP::Command

Private Class Methods

handle_no_command_error(command, has_namespace = $thor_runner) click to toggle source

default_command で指定しても「aboutp クエリ」とかで呼び出すと クエリがコマンドだと認識されるので、 handle_no_command_errorをハンドリングする

# File lib/about_p/command.rb, line 46
def handle_no_command_error(command, has_namespace = $thor_runner)
  Command.new.search(command)
end

Public Instance Methods

key_config() click to toggle source
# File lib/about_p/command.rb, line 22
def key_config
  key = HighLine.new.ask("Enter API key:") { |q| q.echo = "*" }
  key = key.to_s
  Pit.set("about_p", :data => {
    "api_key" => key
  })
  key
end

Private Instance Methods

api_key() click to toggle source
# File lib/about_p/command.rb, line 32
def api_key
  Pit.get("about_p")["api_key"]
end
padding(value, extend_size) click to toggle source
# File lib/about_p/command.rb, line 36
def padding(value, extend_size)
  padding_size = extend_size - value.size
  value if padding_size < 0
  value + (" " * padding_size)
end