Class: Sem4r::NgramGroupsSearchParameter

Inherits:
Object
  • Object
show all
Includes:
Sem4rSoap::SoapAttributes
Defined in:
lib/sem4r/targeting_idea/targeting_idea_selector.rb

Instance Method Summary collapse

Methods included from Sem4rSoap::SoapAttributes

#_from_element, #_to_s, #_to_xml, included

Constructor Details

#initialize(&block) ⇒ NgramGroupsSearchParameter

Returns a new instance of NgramGroupsSearchParameter.



127
128
129
130
131
# File 'lib/sem4r/targeting_idea/targeting_idea_selector.rb', line 127

def initialize(&block)
  if block_given?
    block.arity < 1 ? instance_eval(&block) : block.call(self)
  end
end

Instance Method Details

#to_xmlObject



133
134
135
136
137
138
139
140
# File 'lib/sem4r/targeting_idea/targeting_idea_selector.rb', line 133

def to_xml
  xml = ""
  xml << '<s:searchParameters xsi:type="s:NgramGroupsSearchParameter">'
  ngrams.each do |t|
    xml << "<s:ngramGroups>#{t}</s:ngramGroups>"
  end
  xml << '</s:searchParameters>'
end