Module: MOF::Helper
- Defined in:
- lib/mof/helper.rb
Defined Under Namespace
Classes: Error, ParserError, ScannerError, StyleError
Instance Method Summary
collapse
Instance Method Details
#error_handler(e) ⇒ Object
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
# File 'lib/mof/helper.rb', line 152
def error_handler e
$stderr.puts "*** #{@name}:#{@lineno}:"
case e
when StyleError
$stderr.puts "\t Syntax does not comply to '#{self.style}' style"
when ScannerError
$stderr.puts "\t ScannerError: #{$!}"
when ParserError
$stderr.puts "\t ParserError: #{$!}"
when Error
$stderr.puts "\t Error: #{$!}"
else
$stderr.puts "\t Exception: #{$!}[#{$!.class}]"
$stderr.puts $@
end
end
|
#lineno ⇒ Object
13
14
15
|
# File 'lib/mof/helper.rb', line 13
def lineno
@lineno
end
|
#name ⇒ Object
17
18
19
|
# File 'lib/mof/helper.rb', line 17
def name
@name
end
|
#style ⇒ Object
21
22
23
|
# File 'lib/mof/helper.rb', line 21
def style
@style
end
|