Class: H256::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/h256.rb

Overview

Builder class.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#secretObject (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