class Birdwatcher::Commands::Unset

Public Instance Methods

run() click to toggle source
# File lib/birdwatcher/commands/unset.rb, line 10
def run
  if !arguments?
    error("You must provide an option name")
    return false
  end

  if !current_module
    error("No module loaded")
    return false
  end

  option = arguments.first.upcase
  if !current_module.meta[:options].keys.include?(option)
    error("Unknown option: #{option.bold}")
    return false
  end

  current_module.meta[:options][option][:value] = nil
end

Private Instance Methods

current_module() click to toggle source
# File lib/birdwatcher/commands/unset.rb, line 32
def current_module
  console.current_module
end