Class: Ayadn::SetNiceRank

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

Instance Method Summary collapse

Constructor Details

#initializeSetNiceRank

Returns a new instance of SetNiceRank.



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

def initialize
  Settings.load_config
  Settings.get_token
  Settings.init_config
  Logs.create_logger
end

Instance Method Details

#cache(value) ⇒ Object



287
288
289
# File 'lib/ayadn/set.rb', line 287

def cache value
  Settings.options[:nicerank][:cache] = Validators.cache_range value.to_i
end

#filter(value) ⇒ Object



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

def filter value
  Settings.options[:nicerank][:filter] = Validators.boolean(value)
end

#filter_unranked(value) ⇒ Object



281
282
283
# File 'lib/ayadn/set.rb', line 281

def filter_unranked value
  Settings.options[:nicerank][:filter_unranked] = Validators.boolean(value)
end

#log(args) ⇒ Object



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

def log(args)
  x = "New value for '#{args[0]}' in 'NiceRank' => #{args[1]}"
  puts "\n#{x}\n".color(:cyan)
  Logs.rec.info x
end

#saveObject



275
276
277
# File 'lib/ayadn/set.rb', line 275

def save
  Settings.save_config
end

#threshold(value) ⇒ Object



284
285
286
# File 'lib/ayadn/set.rb', line 284

def threshold value
  Settings.options[:nicerank][:threshold] = Validators.threshold value
end