Class: Clerq::Services::QueryTemplate

Inherits:
Service
  • Object
show all
Defined in:
lib/clerq/services/query_template.rb

Instance Method Summary collapse

Methods inherited from Service

call

Constructor Details

#initialize(template) ⇒ QueryTemplate

Returns a new instance of QueryTemplate.

Parameters:

  • template (String)

    required name of template



15
16
17
18
19
20
21
# File 'lib/clerq/services/query_template.rb', line 15

def initialize(template)
  if !(template.is_a?(String) && !template.empty?)
    msg = "Invailid argument 'template'"
    raise ArgumentError, msg
  end
  @template = template
end

Instance Method Details

#callObject



10
11
12
# File 'lib/clerq/services/query_template.rb', line 10

def call
  Clerq.text_repository.text(@template)
end