Method: Octothorpe#initialize
- Defined in:
- lib/octothorpe.rb
#initialize(hash = nil) ⇒ Octothorpe
:call-seq:
ot = Octothrpe.new(hash)
Initialise an Octothorpe object by passing it a hash.
You can create an empty OT by calling Octothorpe.new, but there’s probably little utility in that, given that it is read-only.
If you pass anything other than nil or something OT can treat as a Hash, you will cause an Octothorpe::BadHash exception.
89 90 91 92 |
# File 'lib/octothorpe.rb', line 89 def initialize(hash=nil) @store = Storage.new( symbol_hash(hash || {}) ) @inner_hash = @store.octothorpe_store end |