Module: OnSIP::ClassMethods

Included in:
OnSIP
Defined in:
lib/onsip.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject



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

def logger
  @logger ||= init_logger
end

#sessionObject

Returns the value of attribute session.



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

def session
  @session
end

Instance Method Details

#auth!(username, password) ⇒ Object



51
52
53
# File 'lib/onsip.rb', line 51

def auth!(username, password)
  @session = Session.create(username, password)
end

#connect(uri, options = {}) ⇒ Object



38
39
40
41
# File 'lib/onsip.rb', line 38

def connect(uri, options = {})
  @options = Hashie::Mash.new options
  @connection = Connection.new(:uri => uri)
end

#connectionObject



43
44
45
# File 'lib/onsip.rb', line 43

def connection
  @connection
end

#init_loggerObject



31
32
33
34
35
36
# File 'lib/onsip.rb', line 31

def init_logger
  @logger = Logger.new(STDOUT)
  @logger.level = Logger::DEBUG

  @logger
end

#optionsObject



47
48
49
# File 'lib/onsip.rb', line 47

def options
  @options
end