Class: Nmax::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/nmax/base.rb

Direct Known Subclasses

Integer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(count) ⇒ Base

Returns a new instance of Base.



5
6
7
# File 'lib/nmax/base.rb', line 5

def initialize(count)
  @count = count
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



3
4
5
# File 'lib/nmax/base.rb', line 3

def count
  @count
end

Instance Method Details

#perform(_) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/nmax/base.rb', line 9

def perform(_)
  yield
rescue Exception => ex
  raise ex if SystemExit === ex
  $stderr.print "#{ex.class}: " if ex.class != RuntimeError
  $stderr.puts ex.message
end