Class: H::Builder
- Inherits:
-
Object
- Object
- H::Builder
- Defined in:
- lib/h.rb
Instance Attribute Summary collapse
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
Instance Method Summary collapse
- #call(value) ⇒ Object
-
#initialize(secret) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(secret) ⇒ Builder
Returns a new instance of Builder.
7 8 9 |
# File 'lib/h.rb', line 7 def initialize(secret) @secret = secret end |
Instance Attribute Details
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
5 6 7 |
# File 'lib/h.rb', line 5 def secret @secret end |
Instance Method Details
#call(value) ⇒ Object
11 12 13 |
# File 'lib/h.rb', line 11 def call(value) ::Digest::SHA256.base64digest("#{value}++#{secret}") end |