lib/socialcastr/api.rb in socialcastr-0.2.14 vs lib/socialcastr/api.rb in socialcastr-0.2.15
- old
+ new
@@ -12,15 +12,18 @@
def initialize(username, password, domain, format="xml",debug=false)
@debug = debug
@username = username
@password = password
@format = format
+ @domain = domain
@endpoint = "https://#{domain}/api/"
return self
end
def profile
- @profile ||= Socialcastr::Community.parse(post("authentication", {:email => @username, :password => @password })).first.profile
+ @profile ||= Socialcastr::Community.parse(post("authentication", {:email => @username, :password => @password })).
+ select { |community| community.domain == @domain }.
+ first.profile
end
def get(path, args={})
https_request(:get, path, args)
end