Class: Shoutout

Inherits:
Object
  • Object
show all
Defined in:
lib/shoutout.rb

Defined Under Namespace

Classes: SMS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(apikey) ⇒ Shoutout



17
18
19
# File 'lib/shoutout.rb', line 17

def initialize(apikey)
  @apikey=apikey
end

Instance Attribute Details

#apikeyObject (readonly)

Init shoutout=Shoutout.new(“APIKEY HERE”)

Example:

>> response=shoutout.sendSms(from:"ShoutTEST",to:"94778811111",body:"This is a test message")
{"status"=>"1001", "description"=>"submit success", "cost"=>1, "responses"=>[{"destination"=>"94778811111", "reference_id"=>"ca31e340-c8f2-11eb-94b7-45623297139f", "status"=>"1001", "cost"=>1}]}

Arguments:

apikey: (String) ShoutOUT Apikey
from: (String) sender ID
to: (Array) receivers phone numbers
body: (String) message body


16
17
18
# File 'lib/shoutout.rb', line 16

def apikey
  @apikey
end

Instance Method Details

#sendSms(from:, to:, body:) ⇒ Object



22
23
24
# File 'lib/shoutout.rb', line 22

def sendSms(from:,to:,body:)
    return SMS.send(self.apikey,from,to,body)
end