Class: Inpay::Checksum::Base
- Inherits:
-
Object
- Object
- Inpay::Checksum::Base
- Defined in:
- lib/inpay/checksum.rb
Overview
checksum base class should only be used as a subclass
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(params) ⇒ Base
constructor
A new instance of Base.
-
#param_string ⇒ Object
build a param_string from given parameters.
-
#result ⇒ Object
build a checksum from given parameters.
Constructor Details
#initialize(params) ⇒ Base
Returns a new instance of Base.
11 12 13 |
# File 'lib/inpay/checksum.rb', line 11 def initialize params @params = params end |
Instance Method Details
#param_string ⇒ Object
build a param_string from given parameters
21 22 23 24 25 |
# File 'lib/inpay/checksum.rb', line 21 def param_string keys.collect do |p| "#{ p }=#{ CGI.escape(@params[:"#{ p }"].to_s) }" end.join('&') end |
#result ⇒ Object
build a checksum from given parameters
16 17 18 |
# File 'lib/inpay/checksum.rb', line 16 def result @_result ||= Digest::MD5.hexdigest(param_string) end |