lib/goby/entity/entity.rb
def use_item(item, entity)
      index = has_item(item)
      if index
        actual_item = inventory[index].first
        actual_item.use(self, entity)
        remove_item(actual_item) if actual_item.consumable
      else
        print NO_SUCH_ITEM_ERROR
      end
    end
# Uses the item, if it exists, on the specified entity.
#
# @param [Item, String] item the item (or its name) to use.
# @param [Entity] entity the entity on which to use the item.
Uses the item, if it exists, on the specified entity.
Uses the item if it exists on the specified entity .
def use_item(item, entity)
      index = has_item(item)
      if index
        actual_item = inventory[index].first
        actual_item.use(self, entity)
        remove_item(actual_item) if actual_item.consumable
      else
        print NO_SUCH_ITEM_ERROR
      end
    end
def use_item ( item , entity ) index = has_item ( item ) if index actual_item = inventory [ index ] . first actual_item . use ( self , entity ) remove_item ( actual_item ) if actual_item . consumable else print NO_SUCH_ITEM_ERROR end end
Uses the item, if it exists, on the specified entity.
Uses the item if it exists on the specified entity .
item
entity
entity the entity on which to use the item.
entity the entity on which to use the item .