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.
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/ayadn/set.rb', line 158 def initialize Settings.load_config Settings.get_token Settings.init_config Logs.create_logger unless Settings.[:nicerank] Settings.[:nicerank] = { threshold: 2.1, cache: 48, filter: true, filter_unranked: false } end unless Settings.[:colors][:nicerank] Settings.[:colors][:nicerank] = :cyan end end |
Instance Method Details
#cache(value) ⇒ Object
192 193 194 |
# File 'lib/ayadn/set.rb', line 192 def cache value Settings.[:nicerank][:cache] = Validators.cache_range value.to_i end |
#filter(value) ⇒ Object
183 184 185 |
# File 'lib/ayadn/set.rb', line 183 def filter value Settings.[:nicerank][:filter] = Validators.boolean(value) end |
#filter_unranked(value) ⇒ Object
186 187 188 |
# File 'lib/ayadn/set.rb', line 186 def filter_unranked value Settings.[:nicerank][:filter_unranked] = Validators.boolean(value) end |
#log(args) ⇒ Object
175 176 177 178 179 |
# File 'lib/ayadn/set.rb', line 175 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
180 181 182 |
# File 'lib/ayadn/set.rb', line 180 def save Settings.save_config end |
#threshold(value) ⇒ Object
189 190 191 |
# File 'lib/ayadn/set.rb', line 189 def threshold value Settings.[:nicerank][:threshold] = Validators.threshold value end |