Class: Keysms::KeyteqService

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

Direct Known Subclasses

Info, SMS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url = "http://app.keysms.no", options = {}) ⇒ KeyteqService

Returns a new instance of KeyteqService.



12
13
14
15
16
# File 'lib/keysms.rb', line 12

def initialize(url = "http://app.keysms.no", options = {})
  @options, @payload, @values = {}, {}, {}
  @options = @options.merge(options)
  @options[:url] = url
end

Instance Attribute Details

#resultObject

Returns the value of attribute result.



10
11
12
# File 'lib/keysms.rb', line 10

def result
  @result
end

Instance Method Details

#authenticate(username, key) ⇒ Object



18
19
20
21
22
23
# File 'lib/keysms.rb', line 18

def authenticate(username, key)
  @options[:auth] = {}
  @options[:auth][:username] = username
  @options[:auth][:key] = key
  self
end