Class: DataWorks::Base
- Inherits:
-
Object
- Object
- DataWorks::Base
- Defined in:
- lib/data_works/base.rb
Instance Method Summary collapse
-
#initialize ⇒ Base
constructor
A new instance of Base.
-
#method_missing(method_name, *args, &block) ⇒ Object
we expose the public interface here.
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
we expose the public interface here
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/data_works/base.rb', line 12 def method_missing(method_name, *args, &block) method_name = method_name.to_s if method_name =~ /\A(add_|the_)(\w+)\Z/ || method_name =~ /\A(\w+)(\d+)\Z/ || method_name =~ /\Aset_(current_default|restriction)\Z/ || method_name =~ /\Aclear_(current_default|restriction)_for\Z/ || method_name == 'visualize' @works.send(method_name, *args, &block) else raise NoMethodError.new("#{method_name} method not found in data works") end end |