Class: StringBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/kube/ctl/string_builder.rb

Instance Method Summary collapse

Instance Method Details

#call(token = nil, **kwargs) ⇒ Object

Override call to handle kwargs: .(description: ‘my frontend’) stores [“my frontend”] in the buffer.



12
13
14
15
16
17
18
19
20
# File 'lib/kube/ctl/string_builder.rb', line 12

def call(token = nil, **kwargs)
  tap do
    if token
      @buffer << [token.to_s, []]
    elsif kwargs.any?
      @buffer << [kwargs]
    end
  end
end