Class: Safer::HashProtocol::Single
- Defined in:
- lib/safer/hashprotocol.rb
Overview
Base class of Safer::HashProtocol implementations that provide some derived value from a single “base” implementation.
Instance Method Summary collapse
-
#initialize(prefix, base) ⇒ Single
constructor
Stores the description and base HashProtocol object in this HashProtocol object.
-
#self ⇒ Object
:attr_reader: base Base HashProtocol object from which this object’s match operation should be derived.
Constructor Details
#initialize(prefix, base) ⇒ Single
Stores the description and base HashProtocol object in this HashProtocol object. The description is derived from the description of the base object, prepended by prefix
.
111 112 113 114 115 |
# File 'lib/safer/hashprotocol.rb', line 111 def initialize(prefix, base) Protocol.instance_conforms?(base) super("#{prefix}#{base.description}") self.safer_hashprotocol_single__base = base end |