Class: KuberKit::ServiceReader::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/kuber_kit/service_reader/reader.rb

Constant Summary collapse

AttributeNotSetError =
Class.new(KuberKit::Error)

Instance Method Summary collapse

Instance Method Details

#read(shell, service) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/kuber_kit/service_reader/reader.rb', line 10

def read(shell, service)
  if service.template_name.nil?
    raise AttributeNotSetError, "Please set template for service using #template method"
  end

  context_helper = context_helper_factory.build_service_context(shell, service)

  renderer.call(shell, service.template_name, context_helper: context_helper)
end