Class: Newslettre::API
- Inherits:
-
Object
- Object
- Newslettre::API
- Defined in:
- lib/newslettre/api.rb
Defined Under Namespace
Classes: ClientFailure, EndpointFailure, NotAuthenticatedFailure
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#format ⇒ Object
Returns the value of attribute format.
-
#password ⇒ Object
Returns the value of attribute password.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #authenticated? ⇒ Boolean
-
#initialize(options = {}) ⇒ API
constructor
A new instance of API.
Constructor Details
#initialize(options = {}) ⇒ API
Returns a new instance of API.
4 5 6 7 8 9 |
# File 'lib/newslettre/api.rb', line 4 def initialize = {} @url = "https://sendgrid.com/api/newsletter" @email = .delete :email @password = .delete :password @format = :json end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
2 3 4 |
# File 'lib/newslettre/api.rb', line 2 def email @email end |
#format ⇒ Object
Returns the value of attribute format.
2 3 4 |
# File 'lib/newslettre/api.rb', line 2 def format @format end |
#password ⇒ Object
Returns the value of attribute password.
2 3 4 |
# File 'lib/newslettre/api.rb', line 2 def password @password end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/newslettre/api.rb', line 2 def url @url end |
Instance Method Details
#authenticated? ⇒ Boolean
11 12 13 |
# File 'lib/newslettre/api.rb', line 11 def authenticated? not email.nil? and not password.nil? end |