lib/demiurge/dsl.rb
# For now, this just declares an InertStateItem for a given name.
# It doesn't change the behavior at all. It just keeps that item
# name from being "orphaned" state that doesn't correspond to any
# state item.
#
# Later, this may be a way to describe how important or transitory
# state is - is it reset like a zone? Completely transient?
# Cleared per reboot?
#
# @param item_name [String] The item name for scoping the state in the Engine
# @param options [Hash] Options about the InertStateItem
# @option options [String] zone The zone this InertStateItem considers itself to be in, defaults to "admin"
# @option options [Hash] state The initial state Hash
# @option options [String] type The object type to instantiate, if not InertStateItem
# @return [void]
# @since 0.0.1
For now, this just declares an InertStateItem for a given name.
It doesn't change the behavior at all. It just keeps that item
name from being "orphaned" state that doesn't correspond to any
state item.

Later, this may be a way to describe how important or transitory
state is - is it reset like a zone. Completely transient.
For now this just declares an InertStateItem for a given name . It doesn ' t change the behavior at all . It just keeps that item name from being " orphaned " state that doesn ' t correspond to any state item . Later this may be a way to describe how important or transitory state is - is it reset like a zone . Completely transient .
def inert(item_name, options = {})
      zone_name = options["zone"] || "admin"
      state = options["state"] || {}
      state.merge! "zone" => zone_name, "home_zone" => zone_name
      inert_item = ::Demiurge::StateItem.from_name_type(@engine, options["type"] || "InertStateItem", item_name, state)
      @engine.register_state_item(inert_item)
      nil
    end
def inert ( item_name , options = { } ) zone_name = options [ "zone" ] || "admin" state = options [ "state" ] || { } state . merge! "zone" => zone_name , "home_zone" => zone_name inert_item = :: Demiurge :: StateItem . from_name_type ( @engine , options [ "type" ] || "InertStateItem" , item_name , state ) @engine . register_state_item ( inert_item ) nil end
For now, this just declares an InertStateItem for a given name.
For now this just declares an InertStateItem for a given name .
None
void
item_name
The item name for scoping the state in the Engine
The item name for scoping the state in the Engine
options
type The object type to instantiate, if not InertStateItem
type The object type to instantiate if not InertStateItem
since
None