File: constructor.rb

package info (click to toggle)
ruby-dependor 1.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 264 kB
  • sloc: ruby: 557; makefile: 2; sh: 1
file content (13 lines) | stat: -rw-r--r-- 227 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
module Dependor
  def self.Constructor(*names)
    eval <<-RUBY

    Module.new do
      def initialize(#{names.join(', ')})
        #{names.map{ |name| "@#{name} = #{name}" }.join("\n") }
      end
    end

    RUBY
  end
end