Class: Object

Inherits:
BasicObject
Defined in:
lib/infobar.rb

Instance Method Summary collapse

Instance Method Details

#infobarObject



167
168
169
# File 'lib/infobar.rb', line 167

def infobar
  ::Infobar.instance
end

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



171
172
173
174
175
176
177
178
179
180
181
# File 'lib/infobar.rb', line 171

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