Module: K8s::ResourceClient::Utils
- Included in:
- K8s::ResourceClient, K8s::ResourceClient
- Defined in:
- lib/k8s/resource_client.rb
Overview
Common helpers used in both class/instance methods
Instance Method Summary collapse
Instance Method Details
#make_query(options) ⇒ Hash, NilClass
29 30 31 32 33 34 35 |
# File 'lib/k8s/resource_client.rb', line 29 def make_query() query = .compact return nil if query.empty? query end |
#selector_query(selector) ⇒ NilClass, String
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/k8s/resource_client.rb', line 12 def selector_query(selector) case selector when nil nil when Symbol selector.to_s when String selector when Hash selector.map{ |k, v| "#{k}=#{v}" }.join ',' else fail "Invalid selector type. #{selector.inspect}" end end |