Class: Smess::Output

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

Direct Known Subclasses

Auto, Clickatell, HttpBase, Test, Twilio

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Output

Returns a new instance of Output.



7
8
9
10
# File 'lib/smess/output.rb', line 7

def initialize(config)
  @config = config
  validate_config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



5
6
7
# File 'lib/smess/output.rb', line 5

def config
  @config
end

#smsObject

Returns the value of attribute sms.



4
5
6
# File 'lib/smess/output.rb', line 4

def sms
  @sms
end

Instance Method Details

#check(code) ⇒ Object

Raises:

  • (NoMethodError)


26
27
28
# File 'lib/smess/output.rb', line 26

def check(code)
  raise NoMethodError.new("Verify API is not supported by this Smess output")
end

#deliverObject

entry point to the sms delivery process.

Raises:

  • (NoMethodError)


18
19
20
# File 'lib/smess/output.rb', line 18

def deliver
  raise NoMethodError.new("You must define deliver in your Smess output class")
end

#send_feedback(_message_sid) ⇒ Object



30
31
32
# File 'lib/smess/output.rb', line 30

def send_feedback(_message_sid)
  nil
end

#validate_configObject

should be used to make a reasonable validation that the configuration provided is good.

Raises:

  • (NoMethodError)


13
14
15
# File 'lib/smess/output.rb', line 13

def validate_config
  raise NoMethodError.new("You must define validate_config in your Smess output class")
end

#verify(using: 'none') ⇒ Object

entry point to the verification process.

Raises:

  • (NoMethodError)


23
24
25
# File 'lib/smess/output.rb', line 23

def verify(using: 'none')
  raise NoMethodError.new("Verify API is not supported by this Smess output")
end