module Bandwidth::Voice::XmlVerb
Public Class Methods
new(data = nil)
click to toggle source
# File lib/bandwidth/voice_lib/bxml/verbs/xml_verb.rb, line 4 def initialize(data = nil) @data = (data || {}).clone() end
Public Instance Methods
compact_hash(hash)
click to toggle source
# File lib/bandwidth/voice_lib/bxml/verbs/xml_verb.rb, line 16 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/voice_lib/bxml/verbs/xml_verb.rb, line 8 def method_missing(name, *args, &block) if name[name.size - 1] == '=' @data[name[0..-2].to_sym] = args[0] else @data[name] end end