Class: H::Builder

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

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