Class: IdentityCRM::Resource
- Inherits:
-
Object
- Object
- IdentityCRM::Resource
- Defined in:
- lib/identity_crm/resource.rb
Instance Method Summary collapse
- #create(params: {}, options: {}) ⇒ Object
- #get(id = nil, params: {}, options: {}) ⇒ Object
-
#initialize(url, user, token) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(url, user, token) ⇒ Resource
Returns a new instance of Resource.
2 3 4 5 6 |
# File 'lib/identity_crm/resource.rb', line 2 def initialize url, user, token @url = url.chomp('/') @user = user @token = token end |
Instance Method Details
#create(params: {}, options: {}) ⇒ Object
8 9 10 |
# File 'lib/identity_crm/resource.rb', line 8 def create params: {}, options: {} request :post, body: params, options: end |
#get(id = nil, params: {}, options: {}) ⇒ Object
12 13 14 |
# File 'lib/identity_crm/resource.rb', line 12 def get id = nil, params: {}, options: {} request :get, path: id.to_s, query: params, options: end |