Exception: PgVerify::Interpret::InvalidDSL_var

Inherits:
Core::Error
  • Object
show all
Defined in:
lib/pg-verify/interpret/interpret.rb

Instance Method Summary collapse

Methods inherited from Core::Error

#to_formatted

Constructor Details

#initialize(message) ⇒ InvalidDSL_var

Returns a new instance of InvalidDSL_var.



36
37
38
# File 'lib/pg-verify/interpret/interpret.rb', line 36

def initialize(message)
    @message = message
end

Instance Method Details

#formattedObject



39
40
41
42
43
44
45
46
47
# File 'lib/pg-verify/interpret/interpret.rb', line 39

def formatted()
    hint = [ "Define variables like this:" ]
    hint << "var <name>: <range> [, init: <condition>]"
    hint << "  where:"
    hint << "  <name>      is the name of the variable"
    hint << "  <range>     is a range of integers like (0..15) or an array of symbols like [ :yes, :no ]"
    hint << "  <condition> is either a value in that range or an expression"
    return @message, nil, hint.join("\n")
end