Module: DefMacro

Defined in:
lib/def_macro.rb

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.cleanse_arg(arg) ⇒ Object



16
17
18
# File 'lib/def_macro.rb', line 16

def self.cleanse_arg(arg)
  arg[/\{([^}]+)\}/,1]
end

.cleanse_body(body) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/def_macro.rb', line 7

def self.cleanse_body(body)
  body = body.split("\n")
  if body.size > 1
    body[1...-1].join("\n")
  else
    cleanse_arg(body.first)
  end
end