Module: OnSIP::ClassMethods
- Included in:
- OnSIP
- Defined in:
- lib/onsip.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #auth!(username, password) ⇒ Object
- #connect(uri, options = {}) ⇒ Object
- #connection ⇒ Object
- #init_logger ⇒ Object
- #options ⇒ Object
Instance Attribute Details
#logger ⇒ Object
28 29 30 |
# File 'lib/onsip.rb', line 28 def logger @logger ||= init_logger end |
#session ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/onsip.rb', line 57 def session if @session && @session.established? @session elsif @username && @password @session = Session.create(@username, @password) end end |
Instance Method Details
#auth!(username, password) ⇒ Object
52 53 54 55 |
# File 'lib/onsip.rb', line 52 def auth!(username, password) @username, @password = username, password @session = Session.create(@username, @password) end |
#connect(uri, options = {}) ⇒ Object
39 40 41 42 |
# File 'lib/onsip.rb', line 39 def connect(uri, = {}) = Hashie::Mash.new @connection = Connection.new(.merge({:uri => uri})) end |
#connection ⇒ Object
44 45 46 |
# File 'lib/onsip.rb', line 44 def connection @connection end |
#init_logger ⇒ Object
32 33 34 35 36 37 |
# File 'lib/onsip.rb', line 32 def init_logger @logger = Logger.new(STDOUT) @logger.level = Logger::DEBUG @logger end |
#options ⇒ Object
48 49 50 |
# File 'lib/onsip.rb', line 48 def end |