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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
# File 'lib/mof/helper.rb', line 174
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
|