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.



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

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



63
64
65
# File 'lib/ruby-progressbar/components/rate.rb', line 63

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

Instance Method Details

#start(*args, &blk) ⇒ Object



59
60
61
# File 'lib/ruby-progressbar/components/rate.rb', line 59

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