Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/appygram.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ def self.configure(params)
if params[:api_key]
Appygram::Config.api_key = params[:api_key]
end
if params[:topic]
Appygram::Config.topic = params[:topic]
end
if params[:appygram_endpoint]
appygram_endpoint = params[:appygram_endpoint]
Appygram::Config.appygram_endpoint = URI appygram_endpoint
Expand All @@ -31,6 +34,7 @@ def self.configure(params)
def self.send(params)
pc = params.clone
pc[:api_key] = Appygram::Config.api_key
pc[:topic] = Appygram::Config.topic unless pc[:topic]
pc[:platform] = Appygram::Config.platform unless pc[:platform]
pc[:software] = Appygram::Config.software unless pc[:software]
if pc[:app_json]
Expand All @@ -51,6 +55,7 @@ def self.send(params)
def self.trace(exception, params = {})
pc = params.clone
pc[:api_key] = Appygram::Config.api_key
pc[:topic] = Appygram::Config.topic unless pc[:topic]
pc[:platform] = Appygram::Config.platform unless pc[:platform]
pc[:software] = Appygram::Config.software unless pc[:software]
if pc[:app_json]
Expand Down Expand Up @@ -79,10 +84,13 @@ def self.trace(exception, params = {})

class Config
class << self
attr_accessor :api_key, :appygram_endpoint, :trace_endpoint, :software, :platform
attr_accessor :api_key, :topic, :appygram_endpoint, :trace_endpoint, :software, :platform
def api_key
return @api_key unless @api_key.nil?
end
def topic
return @topic unless @topic.nil?
end
def appygram_endpoint
return @appygram_endpoint unless @appygram_endpoint.nil?
end
Expand Down