Class: Ayadn::SetBase

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSetBase



269
270
271
272
273
274
275
276
# File 'lib/ayadn/set.rb', line 269

def initialize
  Settings.load_config()
  Settings.get_token()
  Settings.init_config()
  Logs.create_logger()
  @thor = Thor::Shell::Color.new
  @status = Status.new
end

Instance Attribute Details

#categoryObject

Returns the value of attribute category.



267
268
269
# File 'lib/ayadn/set.rb', line 267

def category
  @category
end

#inputObject

Returns the value of attribute input.



267
268
269
# File 'lib/ayadn/set.rb', line 267

def input
  @input
end

#outputObject

Returns the value of attribute output.



267
268
269
# File 'lib/ayadn/set.rb', line 267

def output
  @output
end

Instance Method Details

#logObject



283
284
285
286
287
288
289
# File 'lib/ayadn/set.rb', line 283

def log
  @status.say do
    @thor.say_status(:updated, "'#{@input}' in '#{@category}'", :cyan)
    @thor.say_status(:content, "'#{@output}'", :green)
  end
  Logs.rec.info "new value for '#{@input}' in '#{@category}' => '#{@output}'"
end

#saveObject



278
279
280
281
# File 'lib/ayadn/set.rb', line 278

def save
  Settings.save_config()
  log()
end