Module: CLI::UI::Frame::FrameStack

Defined in:
lib/cli/ui/frame.rb

Constant Summary collapse

ENVVAR =
'CLI_FRAME_STACK'

Class Method Summary collapse

Class Method Details

.itemsObject


290
291
292
# File 'lib/cli/ui/frame.rb', line 290

def self.items
  ENV.fetch(ENVVAR, '').split(':').map(&:to_sym)
end

.popObject


300
301
302
303
304
305
# File 'lib/cli/ui/frame.rb', line 300

def self.pop
  curr = items
  ret = curr.pop
  ENV[ENVVAR] = curr.join(':')
  ret.nil? ? nil : ret.to_sym
end

.push(item) ⇒ Object


294
295
296
297
298
# File 'lib/cli/ui/frame.rb', line 294

def self.push(item)
  curr = items
  curr << item.name
  ENV[ENVVAR] = curr.join(':')
end