Class: ProgressBar::Components::EstimatedTimer::As

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-progressbar/components/estimated_timer.rb

Instance Method Summary collapse

Constructor Details

#initialize(subject, ancestor) ⇒ As

Returns a new instance of As.



75
76
77
78
# File 'lib/ruby-progressbar/components/estimated_timer.rb', line 75

def initialize(subject, ancestor)
  @subject = subject
  @ancestor = ancestor
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &blk) ⇒ Object



84
85
86
# File 'lib/ruby-progressbar/components/estimated_timer.rb', line 84

def method_missing(sym, *args, &blk)
  @ancestor.instance_method(sym).bind(@subject).call(*args,&blk)
end

Instance Method Details

#start(*args, &blk) ⇒ Object



80
81
82
# File 'lib/ruby-progressbar/components/estimated_timer.rb', line 80

def start(*args, &blk)
  @ancestor.instance_method(:start).bind(@subject).call(*args,&blk)
end