module Bandwidth::Xml::XmlVerb
Common functions of each verb class
Public Class Methods
new(data = nil)
click to toggle source
# File lib/bandwidth/xml/xml_verb.rb, line 5 def initialize(data = nil) @data = (data || {}).clone() end
Public Instance Methods
compact_hash(hash)
click to toggle source
# File lib/bandwidth/xml/xml_verb.rb, line 17 def compact_hash(hash) hash.inject({}) do |new_hash, (k,v)| if !v.nil? new_hash[k] = v.class == Hash ? compact_hash(v) : v end new_hash end end
method_missing(name, *args, &block)
click to toggle source
# File lib/bandwidth/xml/xml_verb.rb, line 9 def method_missing(name, *args, &block) if name[name.size - 1] == '=' @data[name[0..-2].to_sym] = args[0] else @data[name] end end