Class: Ernie::Mod
- Inherits:
-
Object
- Object
- Ernie::Mod
- Defined in:
- lib/ernie.rb
Instance Attribute Summary collapse
-
#funs ⇒ Object
Returns the value of attribute funs.
-
#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.
201 202 203 204 |
# File 'lib/ernie.rb', line 201 def initialize(name) self.name = name self.funs = {} end |
Instance Attribute Details
#funs ⇒ Object
Returns the value of attribute funs.
199 200 201 |
# File 'lib/ernie.rb', line 199 def funs @funs end |
#name ⇒ Object
Returns the value of attribute name.
199 200 201 |
# File 'lib/ernie.rb', line 199 def name @name end |
Instance Method Details
#fun(name, block) ⇒ Object
206 207 208 209 |
# File 'lib/ernie.rb', line 206 def fun(name, block) raise TypeError, "block required" if block.nil? self.funs[name] = block end |