Class: IdentityCRM::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/identity_crm/resource.rb

Instance Method Summary collapse

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: 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: options
end