Class: H256::Builder
- Inherits:
-
Object
- Object
- H256::Builder
- Defined in:
- lib/h256.rb
Overview
Builder class.
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.
11 12 13 |
# File 'lib/h256.rb', line 11 def initialize(secret) @secret = secret end |
Instance Attribute Details
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
9 10 11 |
# File 'lib/h256.rb', line 9 def secret @secret end |
Instance Method Details
#call(value) ⇒ Object
15 16 17 |
# File 'lib/h256.rb', line 15 def call(value) ::Digest::SHA256.hexdigest("#{value}++#{secret}") end |