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.



218
219
220
221
222
223
# File 'lib/ayadn/set.rb', line 218

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

Instance Method Details

#cache(value) ⇒ Object



241
242
243
# File 'lib/ayadn/set.rb', line 241

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

#filter(value) ⇒ Object



232
233
234
# File 'lib/ayadn/set.rb', line 232

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

#filter_unranked(value) ⇒ Object



235
236
237
# File 'lib/ayadn/set.rb', line 235

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

#log(args) ⇒ Object



224
225
226
227
228
# File 'lib/ayadn/set.rb', line 224

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

#saveObject



229
230
231
# File 'lib/ayadn/set.rb', line 229

def save
  Settings.save_config
end

#threshold(value) ⇒ Object



238
239
240
# File 'lib/ayadn/set.rb', line 238

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