Module: Interscript::DSL::SymbolMM

Included in:
Document, Items
Defined in:
lib/interscript/dsl/symbol_mm.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, **kwargs, &block) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/interscript/dsl/symbol_mm.rb', line 2

def method_missing sym, *args, **kwargs, &block
  super if args.length > 0
  super if kwargs.length > 0
  super if sym.to_s =~ /[?!=]\z/
  super unless sym.to_s =~ /\A[\w\d]+\z/
  super if block_given?

  sym.to_sym
end