Class: Bulksms::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



29
30
31
32
33
34
35
36
37
# File 'lib/bulksms/configuration.rb', line 29

def initialize
  # Prepare default options
  self.country = :international
  self.port = 5567
  self.message_path = "/eapi/submission/send_sms/2/2.0"
  self.credits_path = "/eapi/user/get_credits/1/1.1"
  self.message_class = 2
  self.routing_group = 2
end

Instance Attribute Details

#countryObject

Set the country code when no host has been provided. Should be one of:

:uk, :usa, :safrica, :spain, :international (default)


14
15
16
# File 'lib/bulksms/configuration.rb', line 14

def country
  @country
end

#credits_pathObject

Path added to host to request credits



21
22
23
# File 'lib/bulksms/configuration.rb', line 21

def credits_path
  @credits_path
end

#hostObject

Overide the default host config so that a short name will be converted into a full hostname.



41
42
43
# File 'lib/bulksms/configuration.rb', line 41

def host
  @host
end

#message_classObject

Message Class, 0 (Flash SMS), 1, 2 (default, normal SMS, stored to SIM card), 3.



24
25
26
# File 'lib/bulksms/configuration.rb', line 24

def message_class
  @message_class
end

#message_pathObject

Path added to host to send a message Known as send_sms method in BulkSMS API.



18
19
20
# File 'lib/bulksms/configuration.rb', line 18

def message_path
  @message_path
end

#passwordObject

Returns the value of attribute password.



7
8
9
# File 'lib/bulksms/configuration.rb', line 7

def password
  @password
end

#portObject

Returns the value of attribute port.



9
10
11
# File 'lib/bulksms/configuration.rb', line 9

def port
  @port
end

#routing_groupObject

Routing group, possible values are 1, 2, 3



27
28
29
# File 'lib/bulksms/configuration.rb', line 27

def routing_group
  @routing_group
end

#usernameObject

Standard connection details



6
7
8
# File 'lib/bulksms/configuration.rb', line 6

def username
  @username
end