lib/goby/entity/entity.rb
def has_item(item)
      inventory.each_with_index do |couple, index|
        return index if couple.first.name.casecmp(item.to_s).zero?
      end
      return
    end
# Returns the index of the specified item, if it exists.
#
# @param [Item, String] item the item (or its name).
# @return [Integer] the index of an existing item. Otherwise nil.
Returns the index of the specified item, if it exists.
Returns the index of the specified item if it exists .
def has_item(item)
      inventory.each_with_index do |couple, index|
        return index if couple.first.name.casecmp(item.to_s).zero?
      end
      return
    end
def has_item ( item ) inventory . each_with_index do | couple , index | return index if couple . first . name . casecmp ( item . to_s ) . zero? end return end
Returns the index of the specified item, if it exists.
Returns the index of the specified item if it exists .
the index of an existing item. Otherwise nil.
the index of an existing item . Otherwise nil .
Integer
item
item the item (or its name).
item the item ( or its name ) .