Module: Dynaload::DynaloadableMethods
- Included in:
- Dynaloadable, Dynaloadable
- Defined in:
- lib/dynaload.rb,
lib/dynaload-0.1.0.rb
Overview
–}}}
Instance Method Summary collapse
-
#dyna_export(*args) ⇒ Object
(also: #export)
–}}}.
-
#dyna_exported ⇒ Object
(also: #exported)
–{{{.
Instance Method Details
#dyna_export(*args) ⇒ Object Also known as: export
–}}}
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/dynaload.rb', line 29 def dyna_export(*args) #--{{{ things, attribute_hashes = args.partition{|arg| not Hash === arg} raise ArgumentError, "nothing given to dyna_export!" if things.empty? attributes = attribute_hashes.inject({}){|h,ah| h.update ah} things.each do |thing| case thing when Class dyna_exported.classes << [thing, attributes] dyna_exported.classes.uniq! when Module dyna_exported.modules << [thing, attributes] dyna_exported.modules.uniq! else dyna_exported.objects << [thing, attributes] dyna_exported.objects.uniq! end end dyna_exported #--}}} end |