Class: Module

Inherits:
Object show all
Defined in:
lib/strokedb/util/attach_dsl.rb

Instance Method Summary collapse

Instance Method Details

#attach_dsl(*mods) ⇒ Object Also known as: attach_dsls

Attach module as DSL. Module may use store_dsl_options method to store DSL.



7
8
9
10
11
12
# File 'lib/strokedb/util/attach_dsl.rb', line 7

def attach_dsl(*mods)
  @dsl_options ||= {}
  mods.each do |mod|
    extend(mod)
  end
end

#dslObject

Return a map of registered DSLs.



23
24
25
# File 'lib/strokedb/util/attach_dsl.rb', line 23

def dsl
  @dsl_options
end

#store_dsl_options(name, opts) ⇒ Object

Store some data associated with a DSL name.



17
18
19
# File 'lib/strokedb/util/attach_dsl.rb', line 17

def store_dsl_options(name, opts)
  @dsl_options[name] = opts
end