Module: Postmark
- Extended by:
- Postmark
- Included in:
- Postmark
- Defined in:
- lib/postmark/response_parsers/active_support.rb,
lib/postmark.rb,
lib/postmark/json.rb,
lib/postmark/error.rb,
lib/postmark/bounce.rb,
lib/postmark/client.rb,
lib/postmark/inbound.rb,
lib/postmark/version.rb,
lib/postmark/inflector.rb,
lib/postmark/api_client.rb,
lib/postmark/http_client.rb,
lib/postmark/deprecations.rb,
lib/postmark/account_api_client.rb,
lib/postmark/helpers/hash_helper.rb,
lib/postmark/response_parsers/json.rb,
lib/postmark/response_parsers/yajl.rb,
lib/postmark/helpers/message_helper.rb,
lib/postmark/mail_message_converter.rb
Overview
assume activesupport is already loaded
Defined Under Namespace
Modules: Deprecations, HashHelper, Inbound, Inflector, Json, MessageHelper, ResponseParsers Classes: AccountApiClient, ApiClient, ApiInputError, Bounce, Client, Error, HttpClient, HttpClientError, HttpServerError, InactiveRecipientError, InternalServerError, InvalidApiKeyError, InvalidEmailRequestError, InvalidTemplateError, MailAdapterError, MailMessageConverter, TimeoutError, UnexpectedHttpResponseError, UnknownMessageType
Constant Summary collapse
- HEADERS =
{ 'User-Agent' => "Postmark Ruby Gem v#{VERSION}", 'Content-type' => 'application/json', 'Accept' => 'application/json' }
- VERSION =
'1.25.1'
- @@api_client_mutex =
Mutex.new
Instance Attribute Summary collapse
- #api_client ⇒ Object
-
#api_token ⇒ Object
(also: #api_key)
Returns the value of attribute api_token.
-
#host ⇒ Object
Returns the value of attribute host.
-
#http_open_timeout ⇒ Object
Returns the value of attribute http_open_timeout.
-
#http_read_timeout ⇒ Object
Returns the value of attribute http_read_timeout.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#path_prefix ⇒ Object
Returns the value of attribute path_prefix.
-
#port ⇒ Object
Returns the value of attribute port.
-
#proxy_host ⇒ Object
Returns the value of attribute proxy_host.
-
#proxy_pass ⇒ Object
Returns the value of attribute proxy_pass.
-
#proxy_port ⇒ Object
Returns the value of attribute proxy_port.
-
#proxy_user ⇒ Object
Returns the value of attribute proxy_user.
- #response_parser_class ⇒ Object
-
#secure ⇒ Object
Returns the value of attribute secure.
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
- #deliver_message(*args) ⇒ Object (also: #send_through_postmark)
- #deliver_messages(*args) ⇒ Object
- #delivery_stats(*args) ⇒ Object
Instance Attribute Details
#api_client ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/postmark.rb', line 55 def api_client return @api_client if @api_client @@api_client_mutex.synchronize do @api_client ||= Postmark::ApiClient.new( self.api_token, :secure => self.secure, :proxy_host => self.proxy_host, :proxy_port => self.proxy_port, :proxy_user => self.proxy_user, :proxy_pass => self.proxy_pass, :host => self.host, :port => self.port, :path_prefix => self.path_prefix, :max_retries => self.max_retries ) end end |
#api_token ⇒ Object Also known as: api_key
Returns the value of attribute api_token.
38 39 40 |
# File 'lib/postmark.rb', line 38 def api_token @api_token end |
#host ⇒ Object
Returns the value of attribute host.
38 39 40 |
# File 'lib/postmark.rb', line 38 def host @host end |
#http_open_timeout ⇒ Object
Returns the value of attribute http_open_timeout.
38 39 40 |
# File 'lib/postmark.rb', line 38 def http_open_timeout @http_open_timeout end |
#http_read_timeout ⇒ Object
Returns the value of attribute http_read_timeout.
38 39 40 |
# File 'lib/postmark.rb', line 38 def http_read_timeout @http_read_timeout end |
#max_retries ⇒ Object
Returns the value of attribute max_retries.
38 39 40 |
# File 'lib/postmark.rb', line 38 def max_retries @max_retries end |
#path_prefix ⇒ Object
Returns the value of attribute path_prefix.
38 39 40 |
# File 'lib/postmark.rb', line 38 def path_prefix @path_prefix end |
#port ⇒ Object
Returns the value of attribute port.
38 39 40 |
# File 'lib/postmark.rb', line 38 def port @port end |
#proxy_host ⇒ Object
Returns the value of attribute proxy_host.
38 39 40 |
# File 'lib/postmark.rb', line 38 def proxy_host @proxy_host end |
#proxy_pass ⇒ Object
Returns the value of attribute proxy_pass.
38 39 40 |
# File 'lib/postmark.rb', line 38 def proxy_pass @proxy_pass end |
#proxy_port ⇒ Object
Returns the value of attribute proxy_port.
38 39 40 |
# File 'lib/postmark.rb', line 38 def proxy_port @proxy_port end |
#proxy_user ⇒ Object
Returns the value of attribute proxy_user.
38 39 40 |
# File 'lib/postmark.rb', line 38 def proxy_user @proxy_user end |
#response_parser_class ⇒ Object
47 48 49 |
# File 'lib/postmark.rb', line 47 def response_parser_class @response_parser_class ||= defined?(ActiveSupport::JSON) ? :ActiveSupport : :Json end |
#secure ⇒ Object
Returns the value of attribute secure.
38 39 40 |
# File 'lib/postmark.rb', line 38 def secure @secure end |
Class Method Details
.const_missing(const_name) ⇒ Object
2 3 4 5 6 |
# File 'lib/postmark/deprecations.rb', line 2 def self.const_missing(const_name) replacement = Deprecations.deprecated_constants.fetch(const_name, nil) || super Deprecations.report("DEPRECATION WARNING: the class #{const_name} is deprecated. Use #{replacement} instead.") replacement end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
51 52 53 |
# File 'lib/postmark.rb', line 51 def configure yield self end |
#deliver_message(*args) ⇒ Object Also known as: send_through_postmark
74 75 76 |
# File 'lib/postmark.rb', line 74 def (*args) api_client.(*args) end |
#deliver_messages(*args) ⇒ Object
79 80 81 |
# File 'lib/postmark.rb', line 79 def (*args) api_client.(*args) end |
#delivery_stats(*args) ⇒ Object
83 84 85 |
# File 'lib/postmark.rb', line 83 def delivery_stats(*args) api_client.delivery_stats(*args) end |