Sha256: 6c7b3894a8ec706b8785cc0be8067ddcfaad19f82508401cae564e571acadbe2

Contents?: true

Size: 549 Bytes

Versions: 1

Compression:

Stored size: 549 Bytes

Contents

module StateMachines
  # Represents a type of module that defines instance / class methods for a
  # state machine
  class HelperModule < Module #:nodoc:
    def initialize(machine, kind)
      @machine = machine
      @kind = kind
    end

    # Provides a human-readable description of the module
    def to_s
      owner_class = @machine.owner_class
      owner_class_name = owner_class.name && !owner_class.name.empty? ? owner_class.name : owner_class.to_s
      "#{owner_class_name} #{@machine.name.inspect} #{@kind} helpers"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
state_machines-0.6.0 lib/state_machines/helper_module.rb