Sha256: a96d77856e4a7feb877598258d0c567e0b0da1900dee143557af4aed08c2f4f2

Contents?: true

Size: 553 Bytes

Versions: 16

Compression:

Stored size: 553 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

16 entries across 16 versions & 2 rubygems

Version Path
state_machines-0.5.0 lib/state_machines/helper_module.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/state_machines-0.2.2/lib/state_machines/helper_module.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/state_machines-0.2.2/lib/state_machines/helper_module.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/state_machines-0.2.2/lib/state_machines/helper_module.rb
state_machines-0.4.0 lib/state_machines/helper_module.rb
state_machines-0.3.0 lib/state_machines/helper_module.rb
state_machines-0.2.2 lib/state_machines/helper_module.rb
state_machines-0.2.1 lib/state_machines/helper_module.rb
state_machines-0.2.0 lib/state_machines/helper_module.rb
state_machines-0.1.4 lib/state_machines/helper_module.rb
state_machines-0.1.3 lib/state_machines/helper_module.rb
state_machines-0.1.2 lib/state_machines/helper_module.rb
state_machines-0.1.1 lib/state_machines/helper_module.rb
state_machines-0.1.0 lib/state_machines/helper_module.rb
state_machines-0.0.2 lib/state_machines/helper_module.rb
state_machines-0.0.1 lib/state_machines/helper_module.rb