Method: CLI::UI::Frame::FrameStack.push

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

.push(item = nil, color: nil, style: nil) ⇒ Object



61
62
63
64
65
66
67
# File 'lib/cli/ui/frame/frame_stack.rb', line 61

def push(item = nil, color: nil, style: nil)
  if color.nil? != style.nil? || item.nil? == color.nil?
    raise ArgumentError, 'Must give one of item or color: and style:'
  end

  items.push(item || StackItem.new(T.must(color), T.must(style)))
end