Module: Jetski::Helpers::Delegatable

Included in:
Model, ViewRenderer
Defined in:
lib/jetski/helpers/delegatable.rb

Instance Method Summary collapse

Instance Method Details

#delegate(*delegatables, to:) ⇒ Object

delegate(:method, to: :class) Allows you to delegate a method to another class



6
7
8
9
10
11
12
# File 'lib/jetski/helpers/delegatable.rb', line 6

def delegate(*delegatables, to:)
  delegatables.each do |method_name|
    define_method method_name do
      public_send(to).public_send(method_name)
    end
  end
end