Class: BotAway::Spinner
- Inherits:
-
Object
- Object
- BotAway::Spinner
- Defined in:
- lib/bot-away/spinner.rb
Instance Method Summary collapse
- #encode(real_field_name) ⇒ Object
-
#initialize(ip, key, secret) ⇒ Spinner
constructor
A new instance of Spinner.
- #spinner ⇒ Object
Constructor Details
#initialize(ip, key, secret) ⇒ Spinner
Returns a new instance of Spinner.
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/bot-away/spinner.rb', line 2 def initialize(ip, key, secret) raise "Shouldn't have a nil ip" unless ip raise "Shouldn't have a nil secret" unless secret secret = File.join(#Time.now.to_i.to_s, ip, key.to_s, secret) #puts secret @spinner = Digest::MD5.hexdigest(secret) #puts @spinner end |
Instance Method Details
#encode(real_field_name) ⇒ Object
19 20 21 |
# File 'lib/bot-away/spinner.rb', line 19 def encode(real_field_name) Digest::MD5.hexdigest(File.join(real_field_name.to_s, spinner)) end |
#spinner ⇒ Object
15 16 17 |
# File 'lib/bot-away/spinner.rb', line 15 def spinner @spinner end |