Sha256: 96afa4a3953cf740d0a8fbabd1de0433b94525db15a008ed9242a861e9ba64cc

Contents?: true

Size: 1.03 KB

Versions: 32

Compression:

Stored size: 1.03 KB

Contents

module Krikri
  ##
  # Base class for behaviors related to entities that are generated or revised
  # by activities.
  #
  # A SoftwareAgent implements #entity_behavior, which returns an appropriate
  # subclass of EntityBehavior.  When an Activity is queried for its entities,
  # it instantiates an instance of its particular SoftwareAgent, and then
  # calls the #entities method of the agent's entity behavior.
  #
  # @see Krikri::Activity#entities
  # @see lib/krikri/entity_behaviors
  #
  class EntityBehavior
    attr_reader :activity
    def initialize(activity)
      @activity = activity
    end

    ##
    # Return an Enumerator of objects that have been affected by our @activity.
    #
    # @return [Enumerator] objects
    # @see lib/krikri/entity_behaviors
    # @see Krikri::Activity#entities
    #
    def entities
      raise NotImplementedError 
    end

    ##
    # @see Krikri::Activity#entities
    # @see Krikri::EntityBehavior#entities
    #
    def self.entities(activity)
      new(activity).entities
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
krikri-0.11.2 lib/krikri/entity_behavior.rb
krikri-0.11.1 lib/krikri/entity_behavior.rb
krikri-0.11.0 lib/krikri/entity_behavior.rb
krikri-0.10.1 lib/krikri/entity_behavior.rb
krikri-0.10.0 lib/krikri/entity_behavior.rb
krikri-0.9.0 lib/krikri/entity_behavior.rb
krikri-0.8.9 lib/krikri/entity_behavior.rb
krikri-0.8.8 lib/krikri/entity_behavior.rb
krikri-0.8.7 lib/krikri/entity_behavior.rb
krikri-0.8.6 lib/krikri/entity_behavior.rb
krikri-0.8.5 lib/krikri/entity_behavior.rb
krikri-0.8.4 lib/krikri/entity_behavior.rb
krikri-0.8.3 lib/krikri/entity_behavior.rb
krikri-0.8.2 lib/krikri/entity_behavior.rb
krikri-0.8.1 lib/krikri/entity_behavior.rb
krikri-0.8.0 lib/krikri/entity_behavior.rb
krikri-0.7.6 lib/krikri/entity_behavior.rb
krikri-0.7.5 lib/krikri/entity_behavior.rb
krikri-0.7.4 lib/krikri/entity_behavior.rb
krikri-0.7.3 lib/krikri/entity_behavior.rb