module Msg91sms
Constants
- VERSION
Attributes
configuration[RW]
Public Class Methods
configure() { |configuration| ... }
click to toggle source
Passing a block to our class When we call Msg91sms.configure
, we pass it a block that actually creates a new instance of the Msg91sms::Configuration
class using whatever we’ve set inside of the block.
# File lib/msg91sms.rb, line 27 def self.configure yield(configuration) end
reset()
click to toggle source
Resetting This will reset the @configuration settings to nil if needed in future
# File lib/msg91sms.rb, line 21 def self.reset @configuration = Configuration.new end
verify_mobile?(mobile)
click to toggle source
Helper method checking mobile number contains only numbers
# File lib/msg91sms.rb, line 60 def self.verify_mobile?(mobile) mobile.scan(/\D/).empty? end