Class: Ernicorn::Mod
- Inherits:
-
Object
- Object
- Ernicorn::Mod
- Defined in:
- lib/ernicorn.rb
Instance Attribute Summary collapse
-
#funs ⇒ Object
Returns the value of attribute funs.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #fun(name, block) ⇒ Object
-
#initialize(name) ⇒ Mod
constructor
A new instance of Mod.
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
#funs ⇒ Object
Returns the value of attribute funs.
217 218 219 |
# File 'lib/ernicorn.rb', line 217 def funs @funs end |
#logger ⇒ Object
Returns the value of attribute logger.
217 218 219 |
# File 'lib/ernicorn.rb', line 217 def logger @logger end |
#name ⇒ Object
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
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 |