Class: Modal::ClsInstance
- Inherits:
-
Object
- Object
- Modal::ClsInstance
- Defined in:
- lib/modal/cls.rb
Instance Method Summary collapse
-
#initialize(methods) ⇒ ClsInstance
constructor
A new instance of ClsInstance.
- #method(name) ⇒ Object
Constructor Details
#initialize(methods) ⇒ ClsInstance
Returns a new instance of ClsInstance.
119 120 121 |
# File 'lib/modal/cls.rb', line 119 def initialize(methods) @methods = methods end |
Instance Method Details
#method(name) ⇒ Object
123 124 125 126 127 128 129 |
# File 'lib/modal/cls.rb', line 123 def method(name) func = @methods[name.to_s] unless func raise NotFoundError.new("Method '#{name}' not found on class") end func end |