Permalink
Browse files

allow base_url to be set through config

  • Loading branch information...
1 parent c32d44a commit b74450614e8b6b430c708258b21f0576905afb9e @nitsujw nitsujw committed Nov 11, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/content_service.rb
View
@@ -7,6 +7,7 @@ module ContentService
@@host = "mq.bleedmaps.com"
@@topic = "content_service"
@@connection = nil
+ @@base_url = "content.bleedmaps.com"
def self.set_host(new_host)
@@host = new_host
@@ -20,6 +21,12 @@ def self.set_password(new_pwd)
def self.set_topic_name(new_topic_name)
@@topic = new_topic_name
end
+
+ def self.set_base_url(base_url)
+ @@base_url = base_url
+ end
+
+
def self.publish(obj)
_pub(obj.class.name.downcase, obj.id,'publish')
end
@@ -40,7 +47,7 @@ def self._pub(type, id, action)
def self.deals_for_region(region_id)
begin
- data = RestClient.get("http://content.bleedmaps.com/Query?id=b6517bf9-b168-4325-b7eb-adebfa3c9da0&regionId=#{region_id}&pg=1")
+ data = RestClient.get("http://#{@@base_url}/Query?id=b6517bf9-b168-4325-b7eb-adebfa3c9da0&regionId=#{region_id}&pg=1")
data = JSON.parse data
rescue => e
Rails.logger.warn e

0 comments on commit b744506

Please sign in to comment.