Sha256: c16d61ed2412f0c7258575973ba2f30f4915b63aff300e7e61a1da758d067c45
Contents?: true
Size: 386 Bytes
Versions: 1
Compression:
Stored size: 386 Bytes
Contents
require 'chemistry/element' module Chemistry::Element::DSL extend self def element(name, &definition) if block_given? element_class = Class.new(Chemistry::Element) Chemistry::Element.const_set(name, element_class) element_class.instance_eval &definition if block_given? else raise ArgumentError, "`element` must be given a block" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
chemistry-0.0.2 | lib/chemistry/element/dsl.rb |