Class: Levene::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/levene/connection.rb

Instance Method Summary collapse

Instance Method Details

#bindingObject



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

Returns:

  • (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 (username, password)
   = self.binding. username, password
  true
rescue
  false
end

#logoutObject



20
21
22
23
# File 'lib/levene/connection.rb', line 20

def logout
  self.binding.logout
  @binding = nil
end

#start {|binding| ... } ⇒ Object

Yields:



15
16
17
18
# File 'lib/levene/connection.rb', line 15

def start
  yield binding
  logout
end