Class: Levene::Connection
- Inherits:
-
Object
- Object
- Levene::Connection
- Defined in:
- lib/levene/connection.rb
Instance Method Summary collapse
- #binding ⇒ Object
- #has_session? ⇒ Boolean
- #login(username, password) ⇒ Object
- #logout ⇒ Object
- #start {|binding| ... } ⇒ Object
Instance Method Details
#binding ⇒ Object
11 12 13 |
# File 'lib/levene/connection.rb', line 11 def binding @binding ||= ::Levene.enabled? ? ::RForce::Binding.new('https://login.salesforce.com/services/Soap/u/20.0') : DummyBinding.new end |
#has_session? ⇒ Boolean
25 26 27 |
# File 'lib/levene/connection.rb', line 25 def has_session? !self.binding.instance_variable_get("@session_id").nil? end |
#login(username, password) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/levene/connection.rb', line 4 def login(username, password) login_result = self.binding.login username, password true rescue false end |
#logout ⇒ Object
20 21 22 23 |
# File 'lib/levene/connection.rb', line 20 def logout self.binding.logout @binding = nil end |
#start {|binding| ... } ⇒ Object
15 16 17 18 |
# File 'lib/levene/connection.rb', line 15 def start yield binding logout end |