Class: ProgressBar::Components::Rate::As

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

Instance Method Summary collapse

Constructor Details

#initialize(subject, ancestor) ⇒ As

Returns a new instance of As.



56
57
58
59
# File 'lib/ruby-progressbar/components/rate.rb', line 56

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



65
66
67
# File 'lib/ruby-progressbar/components/rate.rb', line 65

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

Instance Method Details

#start(*args, &blk) ⇒ Object



61
62
63
# File 'lib/ruby-progressbar/components/rate.rb', line 61

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