Class: BERTREM::Mod
- Inherits:
-
Object
- Object
- BERTREM::Mod
- Defined in:
- lib/bertrem/mod.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.
6 7 8 9 |
# File 'lib/bertrem/mod.rb', line 6 def initialize(name) self.name = name self.funs = {} end |
Instance Attribute Details
#funs ⇒ Object
Returns the value of attribute funs.
4 5 6 |
# File 'lib/bertrem/mod.rb', line 4 def funs @funs end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/bertrem/mod.rb', line 4 def name @name end |
Instance Method Details
#fun(name, block) ⇒ Object
11 12 13 14 |
# File 'lib/bertrem/mod.rb', line 11 def fun(name, block) raise TypeError, "block required" if block.nil? self.funs[name] = block end |