Class: Object

Inherits:
BasicObject
Defined in:
lib/infobar.rb

Instance Method Summary collapse

Instance Method Details

#infobarObject



154
155
156
# File 'lib/infobar.rb', line 154

def infobar
  ::Infobar.instance
end

#with_infobar(**opts, &block) ⇒ Object



158
159
160
161
162
163
164
165
166
167
168
# File 'lib/infobar.rb', line 158

def with_infobar(**opts, &block)
  case
  when total = opts[:total].ask_and_send(:to_sym)
    opts[:total] = __send__(total)
  when opts[:total].nil?
    opts[:total] = size
  end
  Infobar.(**opts)
  block and each(&block)
  self
end