Class: BrickFTP::CLI::Config

Inherits:
Thor
  • Object
show all
Defined in:
lib/brick_ftp/cli/config.rb

Instance Method Summary collapse

Instance Method Details

#get(name) ⇒ Object



5
6
7
8
9
# File 'lib/brick_ftp/cli/config.rb', line 5

def get(name)
  abort 'No such configuration.' unless BrickFTP.config.respond_to?(name)

  puts BrickFTP.config.send(name)
end

#set(name, value) ⇒ Object



12
13
14
15
16
17
# File 'lib/brick_ftp/cli/config.rb', line 12

def set(name, value)
  abort 'No such configuration.' unless BrickFTP.config.respond_to?("#{name}=")

  BrickFTP.config.send("#{name}=", value)
  BrickFTP.config.save!
end