Class: MerlinGateway::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.



6
7
8
9
10
11
12
# File 'lib/merlin_gateway/client.rb', line 6

def initialize(options)
	@username      = options[:username]
	@password      = options[:password]
	@access_number = options[:access_number] || '2210'
	@sender_number = options[:sender_number] || @access_number
	@country       = options[:country]       || 'NO'
end

Instance Attribute Details

#access_numberObject

Returns the value of attribute access_number.



4
5
6
# File 'lib/merlin_gateway/client.rb', line 4

def access_number
  @access_number
end

#countryObject

Returns the value of attribute country.



4
5
6
# File 'lib/merlin_gateway/client.rb', line 4

def country
  @country
end

#passwordObject

Returns the value of attribute password.



4
5
6
# File 'lib/merlin_gateway/client.rb', line 4

def password
  @password
end

#sender_numberObject

Returns the value of attribute sender_number.



4
5
6
# File 'lib/merlin_gateway/client.rb', line 4

def sender_number
  @sender_number
end

#usernameObject

Returns the value of attribute username.



4
5
6
# File 'lib/merlin_gateway/client.rb', line 4

def username
  @username
end

Instance Method Details

#new_message(target_number, message, options = {}) ⇒ Object



14
15
16
# File 'lib/merlin_gateway/client.rb', line 14

def new_message(target_number, message, options={})
	::MerlinGateway::SmsMessage.new(target_number, message, options.merge({:client => self}))
end