Class: Class2

Inherits:
Object
  • Object
show all
Defined in:
lib/class2.rb,
lib/class2/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.new(*argz) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/class2.rb', line 13

def new(*argz)
  specs = argz
  namespace = Object

  if specs[0].is_a?(String) || specs[0].is_a?(Module)
    namespace = specs[0].is_a?(String) ? create_namespace(specs.shift) : specs.shift
  end

  specs.each do |spec|
    spec = [spec] unless spec.respond_to?(:each)
    spec.each { |klass, attributes| make_class(namespace, klass, attributes) }
  end

  nil
end