lib/gamefic/plot/entities.rb in gamefic-1.5.1 vs lib/gamefic/plot/entities.rb in gamefic-1.6.0
- old
+ new
@@ -8,11 +8,11 @@
# chair = make Entity, name: 'red chair'
# chair.name #=> 'red chair'
#
# @param cls [Class] The Class of the Entity to be created.
# @param args [Hash] The entity's properties.
- # @return [Entity]
+ # @return [Gamefic::Entity]
def make cls, args = {}, &block
ent = cls.new args, &block
if ent.kind_of?(Entity) == false
raise "Invalid entity class"
end
@@ -40,11 +40,11 @@
# blue_chair make Entity, :name => 'blue chair'
# pick "red chair" #=> red_chair
# pick "blue chair" #=> blue_chair
# pick "chair" #=> IndexError: description is ambiguous
#
- # @param @description [String] The description of the entity
- # @return [Entity] The entity that matches the description
+ # @param description [String] The description of the entity
+ # @return [Gamefic::Entity] The entity that matches the description
def pick(description)
query = Gamefic::Query::Base.new
result = query.match(description, entities)
if result.objects.length == 0
raise IndexError.new("Unable to find entity from '#{description}'")