Module: Tele42

Extended by:
Tele42
Included in:
Tele42
Defined in:
lib/tele42.rb,
lib/tele42/sms.rb,
lib/tele42/base.rb,
lib/tele42/errors.rb,
lib/tele42/version.rb

Defined Under Namespace

Classes: BadLoginDetails, BadMessage, BadNumber, Base, InvalidFrom, InvalidPassword, InvalidRoute, InvalidServer, InvalidUserName, NotEnoughCredits, SMS

Constant Summary collapse

VERSION =
"0.0.1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#callback_urlObject

Returns the value of attribute callback_url.



12
13
14
# File 'lib/tele42.rb', line 12

def callback_url
  @callback_url
end

#debugObject

Returns the value of attribute debug.



12
13
14
# File 'lib/tele42.rb', line 12

def debug
  @debug
end

#loggerObject



37
38
39
# File 'lib/tele42.rb', line 37

def logger
  @logger ||= Logger.new(STDOUT)
end

#passwordObject

Returns the value of attribute password.



12
13
14
# File 'lib/tele42.rb', line 12

def password
  @password
end

#routeObject

Returns the value of attribute route.



12
13
14
# File 'lib/tele42.rb', line 12

def route
  @route
end

#serverObject

Returns the value of attribute server.



12
13
14
# File 'lib/tele42.rb', line 12

def server
  @server
end

#user_agentObject



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

def user_agent
  @user_agent ||= "Tele42 v#{::Tele42::VERSION}"
end

#usernameObject

Returns the value of attribute username.



12
13
14
# File 'lib/tele42.rb', line 12

def username
  @username
end

Instance Method Details

#reset!Object



18
19
20
21
22
23
24
25
26
# File 'lib/tele42.rb', line 18

def reset!
  @_ran_once = false
  @username = nil
  @password = nil
  @server = nil
  @route = nil
  @callback_url = nil
  @user_agent = nil
end

#setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Tele42)

    the object that the method was called on



32
33
34
35
# File 'lib/tele42.rb', line 32

def setup
  yield self unless @_ran_once
  @_ran_once = true
end