Class: Simsen::Base

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::MassAssignmentSecurity, ActiveModel::Validations
Defined in:
lib/simsen/base.rb

Direct Known Subclasses

BulksmsCom

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#messageObject

Returns the value of attribute message.



7
8
9
# File 'lib/simsen/base.rb', line 7

def message
  @message
end

#phone_numberObject

Returns the value of attribute phone_number.



7
8
9
# File 'lib/simsen/base.rb', line 7

def phone_number
  @phone_number
end

#statusObject

Returns the value of attribute status.



7
8
9
# File 'lib/simsen/base.rb', line 7

def status
  @status
end

Class Method Details

.new_sms(message, phone_number) ⇒ Object



13
14
15
16
17
18
# File 'lib/simsen/base.rb', line 13

def self.new_sms(message, phone_number)
  gateway = self.new_in_prepared_state
  gateway.message = message
  gateway.phone_number = phone_number
  gateway
end

Instance Method Details

#deliverObject

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/simsen/base.rb', line 20

def deliver
  raise(NotImplementedError, 'You must implement #deliver in a class inherited from Simsen::Base to implement sms delivery for the selected SMS-Gateway')
end

#passwordObject



24
25
26
# File 'lib/simsen/base.rb', line 24

def password
  Simsen.password
end

#senderObject



28
29
30
# File 'lib/simsen/base.rb', line 28

def sender
  Simsen.sender
end

#testmodeObject



32
33
34
# File 'lib/simsen/base.rb', line 32

def testmode
  Simsen.testmode
end

#testmode_strategyObject



36
37
38
# File 'lib/simsen/base.rb', line 36

def testmode_strategy
  Simsen.testmode_strategy
end

#urlObject



40
41
42
# File 'lib/simsen/base.rb', line 40

def url
  Simsen.url
end

#usernameObject



44
45
46
# File 'lib/simsen/base.rb', line 44

def username
  Simsen.username
end