Class: Convoy::ApiResource
- Inherits:
-
Object
- Object
- Convoy::ApiResource
- Extended by:
- Forwardable
- Includes:
- Convoy::ApiOperations::Request
- Defined in:
- lib/convoy/api_resource.rb
Overview
USAGE resource = Convoy::Resource.create(args) OR resource = Convoy::Resource.new(args) resource.save
Class methods - get, list, create, update, delete. These methods exist as helper methods. Instance methods - get, list, save, delete, update. Core methods class methods rely on.
Direct Known Subclasses
ApiKey, DeliveryAttempt, Endpoint, Event, EventDelivery, PortalLink, Project, Source, Subscription
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ ApiResource
constructor
A new instance of ApiResource.
- #project_base_uri ⇒ Object
Methods included from Convoy::ApiOperations::Request
Constructor Details
#initialize(**kwargs) ⇒ ApiResource
Returns a new instance of ApiResource.
30 31 32 33 34 |
# File 'lib/convoy/api_resource.rb', line 30 def initialize(**kwargs) @params = kwargs[:params].nil? ? {} : kwargs[:params] @query = kwargs[:query].nil? ? {} : kwargs[:query] @data = kwargs[:data].nil? ? {} : kwargs[:data] end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
28 29 30 |
# File 'lib/convoy/api_resource.rb', line 28 def response @response end |
Instance Method Details
#project_base_uri ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/convoy/api_resource.rb', line 36 def project_base_uri if @config.project_id.nil? raise ArgumentError, "Project ID not supplied" end "#{@config.base_uri}/#{@config.path_version}/projects/#{@config.project_id}" end |