Class: MailRoom::Delivery::Postback::Options
- Inherits:
-
Struct
- Object
- Struct
- MailRoom::Delivery::Postback::Options
- Defined in:
- lib/mail_room/delivery/postback.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#jwt ⇒ Object
Returns the value of attribute jwt.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#password ⇒ Object
Returns the value of attribute password.
-
#token ⇒ Object
Returns the value of attribute token.
-
#url ⇒ Object
Returns the value of attribute url.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #basic_auth? ⇒ Boolean
-
#initialize(mailbox) ⇒ Options
constructor
A new instance of Options.
- #jwt_auth? ⇒ Boolean
- #token_auth? ⇒ Boolean
Constructor Details
#initialize(mailbox) ⇒ Options
Returns a new instance of Options.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/mail_room/delivery/postback.rb', line 10 def initialize(mailbox) url = mailbox.delivery_url || mailbox.[:delivery_url] || mailbox.[:url] token = mailbox.delivery_token || mailbox.[:delivery_token] || mailbox.[:token] jwt = initialize_jwt(mailbox.) username = mailbox.[:username] || mailbox.[:delivery_username] password = mailbox.[:password] || mailbox.[:delivery_password] logger = mailbox.logger content_type = mailbox.[:content_type] super(url, token, username, password, logger, content_type, jwt) end |
Instance Attribute Details
#content_type ⇒ Object
Returns the value of attribute content_type
9 10 11 |
# File 'lib/mail_room/delivery/postback.rb', line 9 def content_type @content_type end |
#jwt ⇒ Object
Returns the value of attribute jwt
9 10 11 |
# File 'lib/mail_room/delivery/postback.rb', line 9 def jwt @jwt end |
#logger ⇒ Object
Returns the value of attribute logger
9 10 11 |
# File 'lib/mail_room/delivery/postback.rb', line 9 def logger @logger end |
#password ⇒ Object
Returns the value of attribute password
9 10 11 |
# File 'lib/mail_room/delivery/postback.rb', line 9 def password @password end |
#token ⇒ Object
Returns the value of attribute token
9 10 11 |
# File 'lib/mail_room/delivery/postback.rb', line 9 def token @token end |
#url ⇒ Object
Returns the value of attribute url
9 10 11 |
# File 'lib/mail_room/delivery/postback.rb', line 9 def url @url end |
#username ⇒ Object
Returns the value of attribute username
9 10 11 |
# File 'lib/mail_room/delivery/postback.rb', line 9 def username @username end |
Instance Method Details
#basic_auth? ⇒ Boolean
45 46 47 |
# File 'lib/mail_room/delivery/postback.rb', line 45 def basic_auth? !self[:username].nil? && !self[:password].nil? end |
#jwt_auth? ⇒ Boolean
41 42 43 |
# File 'lib/mail_room/delivery/postback.rb', line 41 def jwt_auth? self[:jwt].valid? end |
#token_auth? ⇒ Boolean
37 38 39 |
# File 'lib/mail_room/delivery/postback.rb', line 37 def token_auth? !self[:token].nil? end |