Class: Ernicorn::Mod

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Mod

Returns a new instance of Mod.



219
220
221
222
223
# File 'lib/ernicorn.rb', line 219

def initialize(name)
  self.name = name
  self.funs = {}
  self.logger = nil
end

Instance Attribute Details

#funsObject

Returns the value of attribute funs.



217
218
219
# File 'lib/ernicorn.rb', line 217

def funs
  @funs
end

#loggerObject

Returns the value of attribute logger.



217
218
219
# File 'lib/ernicorn.rb', line 217

def logger
  @logger
end

#nameObject

Returns the value of attribute name.



217
218
219
# File 'lib/ernicorn.rb', line 217

def name
  @name
end

Instance Method Details

#fun(name, block) ⇒ Object

Raises:

  • (TypeError)


225
226
227
228
# File 'lib/ernicorn.rb', line 225

def fun(name, block)
  raise TypeError, "block required" if block.nil?
  self.funs[name] = block
end