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.



294
295
296
297
298
299
300
# File 'lib/ayadn/set.rb', line 294

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.



292
293
294
# File 'lib/ayadn/set.rb', line 292

def category
  @category
end

#inputObject

Returns the value of attribute input.



292
293
294
# File 'lib/ayadn/set.rb', line 292

def input
  @input
end

#outputObject

Returns the value of attribute output.



292
293
294
# File 'lib/ayadn/set.rb', line 292

def output
  @output
end

Instance Method Details

#logObject



307
308
309
310
311
312
313
# File 'lib/ayadn/set.rb', line 307

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



302
303
304
305
# File 'lib/ayadn/set.rb', line 302

def save
  Settings.save_config()
  log()
end