Class: Sendgrid::API::REST::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/sendgrid/api/rest/resource.rb

Constant Summary collapse

ENDPOINT =
'https://api.sendgrid.com/api'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



10
11
12
# File 'lib/sendgrid/api/rest/resource.rb', line 10

def key
  @key
end

#userObject (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