Class: Ayadn::SetBase

Inherits:
Object show all
Defined in:
lib/ayadn/set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSetBase

Returns a new instance of SetBase.



320
321
322
323
324
325
326
# File 'lib/ayadn/set.rb', line 320

def initialize
  Settings.load_config()
  Settings.get_token()
  Settings.init_config()
  Logs.create_logger()
  @status = Status.new
end

Instance Attribute Details

#categoryObject

Returns the value of attribute category.



318
319
320
# File 'lib/ayadn/set.rb', line 318

def category
  @category
end

#inputObject

Returns the value of attribute input.



318
319
320
# File 'lib/ayadn/set.rb', line 318

def input
  @input
end

#outputObject

Returns the value of attribute output.



318
319
320
# File 'lib/ayadn/set.rb', line 318

def output
  @output
end

Instance Method Details

#logObject



333
334
335
336
337
338
339
# File 'lib/ayadn/set.rb', line 333

def log
  @status.say do
    @status.say_cyan :updated, "'#{@input}' in '#{@category}'"
    @status.say_green :content, "'#{@output}'"
  end
  Logs.rec.info "new value for '#{@input}' in '#{@category}' => '#{@output}'"
end

#saveObject



328
329
330
331
# File 'lib/ayadn/set.rb', line 328

def save
  Settings.save_config()
  log()
end