Sha256: 1ec2eda58b794daa894dc4d512a3e42dab79c7881cbbd6daa61eae69268b6520

Contents?: true

Size: 645 Bytes

Versions: 27

Compression:

Stored size: 645 Bytes

Contents

Loquor::Interactors.each do |name, path|
  klass = Class.new(Object) do
    extend Loquor::Interactor::ClassMethods
    include Loquor::Interactor::InstanceMethods

    instance_eval <<-EOS
      def path
        "#{path}"
      end
    EOS
  end

  # Split off the Group and Discussion parts
  name_parts = name.split("::")
  klass_name = name_parts.pop

  # Create base modules
  const = Loquor
  name_parts.each do |name_part|
    const.const_set(name_part, Module.new) unless const.const_defined?(name_part)
    const = const.const_get(name_part)
  end

  # Define the actual klass at the right point
  const.const_set klass_name, klass
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
loquor-1.13.0 lib/loquor/interactors.rb
loquor-1.12.0 lib/loquor/interactors.rb
loquor-1.11.0 lib/loquor/interactors.rb
loquor-1.10.0 lib/loquor/interactors.rb
loquor-1.9.0 lib/loquor/interactors.rb
loquor-1.8.0 lib/loquor/interactors.rb
loquor-1.7.0 lib/loquor/interactors.rb
loquor-1.6.0 lib/loquor/interactors.rb
loquor-1.5.0 lib/loquor/interactors.rb
loquor-1.4.0 lib/loquor/interactors.rb
loquor-1.3.0 lib/loquor/interactors.rb
loquor-1.2.1 lib/loquor/interactors.rb
loquor-1.2.0 lib/loquor/interactors.rb
loquor-1.1.1 lib/loquor/interactors.rb
loquor-1.1.0 lib/loquor/interactors.rb
loquor-1.0.0 lib/loquor/interactors.rb
loquor-0.9.0 lib/loquor/interactors.rb
loquor-0.8.0 lib/loquor/interactors.rb
loquor-0.7.0 lib/loquor/interactors.rb
loquor-0.6.0 lib/loquor/interactors.rb