Class: Lh::Session
Class Method Summary collapse
- .establish(opts = {}) ⇒ Object
- .establish_with_defaults ⇒ Object
- .establish_with_opts(opts) ⇒ Object
Class Method Details
.establish(opts = {}) ⇒ Object
137 138 139 140 |
# File 'lib/lh.rb', line 137 def self.establish (opts = {}) if opts.empty? then Lh::Session.establish_with_defaults else Lh::Session.establish_with_opts(opts) end end |
.establish_with_defaults ⇒ Object
148 149 150 |
# File 'lib/lh.rb', line 148 def self.establish_with_defaults Lh::Session.establish(Lh.load_opts) end |
.establish_with_opts(opts) ⇒ Object
142 143 144 145 146 |
# File 'lib/lh.rb', line 142 def self.establish_with_opts (opts) ::Lighthouse.account = opts[:account] if opts[:token].present? then ::Lighthouse.token = opts[:token] else ::Lighthouse.authenticate(opts[:user], opts[:password]) end end |