Class: Modal::ClsInstance

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

Instance Method Summary collapse

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