Class: Viadeo::Util

Inherits:
Object
  • Object
show all
Defined in:
lib/viadeo/util.rb

Class Method Summary collapse

Class Method Details

.convert_to_graph_object(data, access_token) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/viadeo/util.rb', line 4

def convert_to_graph_object(data, access_token)
  case data
  when Array
    data.map {|v| convert_to_graph_object(v, access_token) }
  when Hash
    data[:id].nil? ? data : Viadeo::GraphObject.new_from(data, access_token)
  else
    data
  end
end

.filter_response(response) ⇒ Object



15
16
17
18
# File 'lib/viadeo/util.rb', line 15

def filter_response(response)
  data = response.body.split("\r\n\r\n")[-1]
  data = MultiJson.load(data, :symbolize_keys => true)
end