module PostageApp
Constants
- VERSION
Call this method to modify your configuration Example:
PostageApp.configure do |config| config.api_key = '1234567890abcdef' if Rails.env.staging? config.recipient_override = 'test@test.test' end end
If you do not want/need to initialize the gem in this way, you can use the environment variable POSTAGEAPP_API_KEY to set up your key.
Public Class Methods
config()
click to toggle source
Accessor for the PostageApp::Configuration
object Example use:
PostageApp.configuration.api_key = '1234567890abcdef'
# File lib/postageapp.rb, line 43 def self.config @config ||= Configuration.new end
Also aliased as: configuration
config_reset!()
click to toggle source
# File lib/postageapp.rb, line 47 def self.config_reset! @config = nil end
Also aliased as: configuration_reset!
configure(reset: false) { |config| ... }
click to toggle source
# File lib/postageapp.rb, line 32 def self.configure(reset: false) if (reset) self.config_reset! end yield(self.config) end
logger()
click to toggle source
Logger
for the plugin
# File lib/postageapp.rb, line 57 def self.logger @logger ||= begin config.logger || PostageApp::Logger.new( if (config.project_root) FileUtils.mkdir_p(File.join(File.expand_path(config.project_root), 'log')) File.join(config.project_root, "log/postageapp_#{config.environment}.log") else $stdout end ) end end
version()
click to toggle source
# File lib/postageapp.rb, line 28 def self.version VERSION end