Sha256: ea5bff83d0a2841111d69e8890fd020a567d29aadeb04ac210d6296422f38391

Contents?: true

Size: 346 Bytes

Versions: 4

Compression:

Stored size: 346 Bytes

Contents

module Degica
  class ObjectCollection < Collection
    def actions
      map { |obj| Action.new(obj.name, obj) }
    end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
degica-1.0.3 lib/degica/collections/object_collection.rb
degica-1.0.2 lib/degica/collections/object_collection.rb
degica-1.0.1 lib/degica/collections/object_collection.rb
degica-1.0.0 lib/degica/collections/object_collection.rb