Class: Sem4r::BulkMutateJobSelector

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

Instance Method Summary collapse

Methods included from Sem4rSoap::SoapAttributes

#_from_element, #_to_s, #_to_xml, included

Constructor Details

#initialize(&block) ⇒ BulkMutateJobSelector

Returns a new instance of BulkMutateJobSelector.



40
41
42
43
44
# File 'lib/sem4r/bulk_mutate_job/bulk_mutate_job_selector.rb', line 40

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

Instance Method Details

#to_xml(tag = "selector") ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/sem4r/bulk_mutate_job/bulk_mutate_job_selector.rb', line 46

def to_xml(tag = "selector")
  builder = Builder::XmlMarkup.new
  builder.tag!(tag) do |t|

    t.includeHistory history unless history.nil?
    t.includeStats stats unless stats.nil?

    unless jobIds.empty?
      jobIds.each { |i| t.jobIds i }
    end


    unless statuss.empty?
      statuss.each { |f| t.jobStatuses f }
    end
  end
end