Class: Contacts

Inherits:
Object
  • Object
show all
Defined in:
lib/contacts/inbox_lt.rb,
lib/contacts/tonline_de.rb,
lib/contacts/json_picker.rb

Defined Under Namespace

Classes: InboxLt, TonlineDe

Class Method Summary collapse

Class Method Details

.parse_json(string) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/contacts/json_picker.rb', line 6

def self.parse_json( string )
  if Object.const_defined?('ActiveSupport') and
     ActiveSupport.const_defined?('JSON')
    ActiveSupport::JSON.decode( string )
  elsif Object.const_defined?('JSON')
    JSON.parse( string )
  else
    raise 'Contacts requires JSON or Rails (with ActiveSupport::JSON)'
  end
end