Module: PerformLater::Initialization
- Defined in:
- lib/perform_later/initialization.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
3 4 5 |
# File 'lib/perform_later/initialization.rb', line 3 def self.included(base) raise "#{self.name} must be prepended, not included for it to have any effect on #{base.name}" end |
Instance Method Details
#initialize(*args) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/perform_later/initialization.rb', line 7 def initialize(*args) # initialization with explicit # args, pass on if args.length > 0 super(*args) else # initialization without args, # dynamically match message signature # with nil values super_params = method(__method__).super_method.parameters nil_args = Array.new(super_params.count{|param_array| param_array.first == :req}, nil) super(*nil_args) end end |