Class: Degica::ObjectCollection

Inherits:
Collection
  • Object
show all
Defined in:
lib/degica/collections/object_collection.rb

Direct Known Subclasses

InventoryCollection

Instance Method Summary collapse

Methods inherited from Collection

#<<, #initialize

Methods included from Actionable

#do, #prompt

Constructor Details

This class inherits a constructor from Degica::Collection

Instance Method Details

#actionsObject



3
4
5
# File 'lib/degica/collections/object_collection.rb', line 3

def actions
  map { |obj| Action.new(obj.name, obj) }
end

#describeObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/degica/collections/object_collection.rb', line 7

def describe
  if empty?
    nil
  else
    desc = []
    desc << "There are some objects here:"
    desc << "[" + map(&:name).join(',') + "]"
    desc.join("\n")
  end
end