Module: Sem4r::TargetingIdeaExtension

Included in:
Account
Defined in:
lib/sem4r/targeting_idea/targeting_idea_account_extension.rb

Instance Method Summary collapse

Instance Method Details

#p_targeting_idea(&block) ⇒ Object



42
43
44
45
# File 'lib/sem4r/targeting_idea/targeting_idea_account_extension.rb', line 42

def p_targeting_idea(&block)
  targeting_ideas = targeting_idea(&block)
  targeting_ideas.each{ |idea| puts idea }
end

#targeting_idea(&block) ⇒ Object

Targeting Idea



31
32
33
34
35
36
37
38
39
40
# File 'lib/sem4r/targeting_idea/targeting_idea_account_extension.rb', line 31

def targeting_idea(&block)
  selector = TargetingIdeaSelector.new(&block)
  soap_message = service.targeting_idea.get(credentials, selector.to_xml)
  add_counters( soap_message.counters )
  rval = soap_message.response.at_xpath("//getResponse/rval")
  els = rval.xpath("entries")
  els.map do |el|
    TargetingIdea.from_element( el )
  end
end