Module: ADSL::Verification::Utils

Included in:
FormulaGenerators, VerificationCase
Defined in:
lib/adsl/verification/utils.rb

Instance Method Summary collapse

Instance Method Details

#classname_for_classname(klass) ⇒ Object



15
16
17
# File 'lib/adsl/verification/utils.rb', line 15

def classname_for_classname(klass)
  klass.is_a?(Module) ? klass.name : klass.to_s.camelize
end

#infer_classname_from_varname(varname) ⇒ Object



11
12
13
# File 'lib/adsl/verification/utils.rb', line 11

def infer_classname_from_varname(varname)
  varname.to_s.match(/^(\w+?)(?:_*\d+)?$/)[1].camelize
end

#t(text) ⇒ Object



7
8
9
# File 'lib/adsl/verification/utils.rb', line 7

def t(text)
  ADSL::Parser::ASTIdent.new :text => text.to_s
end