class Burner::Data

Defines a key value pair data store per our library. It is basically a composite object around a hash with indifferent key typing.

Attributes

internal_hash[R]

Public Class Methods

new(hash = {}) click to toggle source
# File lib/burner/data.rb, line 18
def initialize(hash = {})
  @internal_hash = {}

  (hash || {}).each { |k, v| self[k] = v }
end

Public Instance Methods

==(other) click to toggle source
# File lib/burner/data.rb, line 36
def ==(other)
  other.instance_of?(self.class) &&
    to_h == other.to_h
end
Also aliased as: eql?
[](key) click to toggle source
# File lib/burner/data.rb, line 28
def [](key)
  internal_hash[key.to_s]
end
[]=(key, value) click to toggle source
# File lib/burner/data.rb, line 24
def []=(key, value)
  internal_hash[key.to_s] = value
end
eql?(other)
Alias for: ==
to_h() click to toggle source
# File lib/burner/data.rb, line 32
def to_h
  internal_hash
end