lib/demiurge.rb
# Register a new StateItem type with a name that will be used in structured {Demiurge::StateItem} dumps.
#
# @param name [String] The name to use when registering this type
# @param klass [Class] The StateItem class to register with this name
# @return [void]
# @since 0.0.1
Register a new StateItem type with a name that will be used in structured {Demiurge::StateItem} dumps.
Register a new StateItem type with a name that will be used in structured { Demiurge :: StateItem } dumps .
def register_type(name, klass)
      if @klasses[name] && @klasses[name] != klass
        raise "Re-registering name with different type! Name: #{name.inspect} Class: #{klass.inspect} OldClass: #{@klasses[name].inspect}!"
      end
      @klasses[name] ||= klass
      nil
    end
def register_type ( name , klass ) if @klasses [ name ] && @klasses [ name ] != klass raise "Re-registering name with different type! Name: #{name.inspect} Class: #{klass.inspect} OldClass: #{@klasses[name].inspect}!" end @klasses [ name ] ||= klass nil end
Register a new StateItem type with a name that will be used in structured {Demiurge::StateItem} dumps.
Register a new StateItem type with a name that will be used in structured { Demiurge :: StateItem } dumps .
None
void
name
The name to use when registering this type
The name to use when registering this type
klass
The StateItem class to register with this name
The StateItem class to register with this name
since
None