Class: Ayadn::SetNiceRank
- Inherits:
-
Object
- Object
- Ayadn::SetNiceRank
- Defined in:
- lib/ayadn/set.rb
Instance Method Summary collapse
- #cache(value) ⇒ Object
- #filter(value) ⇒ Object
- #filter_unranked(value) ⇒ Object
-
#initialize ⇒ SetNiceRank
constructor
A new instance of SetNiceRank.
- #log(args) ⇒ Object
- #save ⇒ Object
- #threshold(value) ⇒ Object
Constructor Details
#initialize ⇒ SetNiceRank
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.[: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.[: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.[: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 |
#save ⇒ Object
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.[:nicerank][:threshold] = Validators.threshold value end |