Class: Sendgrid::API::Service

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource) ⇒ Service

Returns a new instance of Service.



7
8
9
# File 'lib/sendgrid/api/service.rb', line 7

def initialize(resource)
  @resource = resource
end

Instance Attribute Details

#resourceObject (readonly)

Returns the value of attribute resource.



5
6
7
# File 'lib/sendgrid/api/service.rb', line 5

def resource
  @resource
end

Instance Method Details

#perform_request(entity, url, params = {}) ⇒ Object



11
12
13
# File 'lib/sendgrid/api/service.rb', line 11

def perform_request(entity, url, params = {})
  entity.from_response(request(url, params))
end