Class: Sem4r::RelatedToKeywordSearchParameter

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) ⇒ RelatedToKeywordSearchParameter

Returns a new instance of RelatedToKeywordSearchParameter.



33
34
35
36
37
# File 'lib/sem4r/targeting_idea/targeting_idea_selector.rb', line 33

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

Instance Method Details

#to_xmlObject



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/sem4r/targeting_idea/targeting_idea_selector.rb', line 39

def to_xml
  xml = ""
  xml << '<s:searchParameters xsi:type="s:RelatedToKeywordSearchParameter">'
  texts.each do |t|
    xml << '<s:keywords xsi:type="Keyword">'
      xml << "<Criterion.Type>Keyword</Criterion.Type>"
      xml << "<text>#{t}</text>"
      xml << "<matchType>#{match_type}</matchType>"
    xml << "</s:keywords>"
  end
  xml << '</s:searchParameters>'
end