Module: Twilio::Config
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Method Details
#setup(opts = {}, &blk) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/twilio/config.rb', line 3 def setup(opts={}, &blk) if block_given? instance_eval &blk warn 'The block syntax for configuration is deprecated. Use an options hash instead, e.g. Twilio::Config.setup account_sid: "AC00000000000000000000000", auth_token: "xxxxxxxxxxxxxxxxxxx"' else opts.map do |k,v| const = k.to_s.upcase Twilio.const_set(const, v) unless Twilio.const_defined? const end end end |