Class: Sendgrid::API::REST::Resource
- Inherits:
-
Object
- Object
- Sendgrid::API::REST::Resource
- Defined in:
- lib/sendgrid/api/rest/resource.rb
Constant Summary collapse
- ENDPOINT =
'https://sendgrid.com/api'.freeze
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(user, key) ⇒ Resource
constructor
A new instance of Resource.
- #post(url, params = {}) ⇒ Object
Constructor Details
#initialize(user, key) ⇒ Resource
Returns a new instance of Resource.
14 15 16 17 |
# File 'lib/sendgrid/api/rest/resource.rb', line 14 def initialize(user, key) @user = user @key = key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
10 11 12 |
# File 'lib/sendgrid/api/rest/resource.rb', line 10 def key @key end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
10 11 12 |
# File 'lib/sendgrid/api/rest/resource.rb', line 10 def user @user end |
Instance Method Details
#post(url, params = {}) ⇒ Object
19 20 21 |
# File 'lib/sendgrid/api/rest/resource.rb', line 19 def post(url, params = {}) request(:post, url, params) end |