Module: Googletastic::Mixins::Namespaces::ClassMethods

Defined in:
lib/googletastic/mixins/namespaces.rb

Instance Method Summary collapse

Instance Method Details

#ns(name) ⇒ Object



25
26
27
# File 'lib/googletastic/mixins/namespaces.rb', line 25

def ns(name)
  NAMESPACES[name]
end

#ns_tag(name) ⇒ Object



29
30
31
# File 'lib/googletastic/mixins/namespaces.rb', line 29

def ns_tag(name)
  {name => ns(name)}
end

#ns_xml(*names) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/googletastic/mixins/namespaces.rb', line 33

def ns_xml(*names)
  first = names[0]
  names.inject({}) do |hash, name|
    xmlns = "xmlns"
    xmlns << ":#{name}" unless name == first
    hash[xmlns] = ns(name)
    hash
  end
end