Module: Rews::Update::Xml

Defined in:
lib/rews/update.rb

Class Method Summary collapse

Class Method Details

.update_tag(type) ⇒ Object



31
32
33
34
# File 'lib/rews/update.rb', line 31

def update_tag(type)
  # final component of module scoped classname
  type.to_s[/(?:^|::)([^:]+)$/, 1].to_sym
end

.write_update(type, field_uri, item_expr) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/rews/update.rb', line 22

def write_update(type, field_uri, item_expr)
  xml = Builder::XmlMarkup.new
  xml.t(update_tag(type)) do
    xml.t :FieldURI, :FieldURI=>field_uri
    xml << Util.rsxml_to_xml(item_expr)
  end
  xml.target!
end