Class: FinAppsCore::REST::Resources

Inherits:
Object
  • Object
show all
Includes:
Utils::Loggeable, Utils::ParameterFilter, Utils::Validatable
Defined in:
lib/finapps_core/rest/resources.rb

Overview

:nodoc:

Constant Summary

Constants included from Utils::ParameterFilter

Utils::ParameterFilter::PROTECTED_KEYS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::ParameterFilter

#skip_sensitive_data

Methods included from Utils::Validatable

#nil_or_empty?, #not_blank

Methods included from Utils::Loggeable

#logger

Constructor Details

#initialize(client) ⇒ FinAppsCore::REST::Resources

Parameters:

  • client (FinAppsCore::REST::Client)


19
20
21
22
23
# File 'lib/finapps_core/rest/resources.rb', line 19

def initialize(client)
  not_blank(client, :client)
  @client = client
  @logger = client.logger if client.respond_to?(:logger)
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



15
16
17
# File 'lib/finapps_core/rest/resources.rb', line 15

def client
  @client
end

Instance Method Details

#create(params = {}, path = nil) ⇒ Object



34
35
36
# File 'lib/finapps_core/rest/resources.rb', line 34

def create(params={}, path=nil)
  send_request path, :post, params
end

#destroy(id = nil, path = nil) ⇒ Object



42
43
44
# File 'lib/finapps_core/rest/resources.rb', line 42

def destroy(id=nil, path=nil)
  send_request_for_id path, :delete, id
end

#list(path = nil) ⇒ Object



25
26
27
28
# File 'lib/finapps_core/rest/resources.rb', line 25

def list(path=nil)
  path = end_point.to_s if path.nil?
  send_request path, :get
end

#show(id = nil, path = nil) ⇒ Object



30
31
32
# File 'lib/finapps_core/rest/resources.rb', line 30

def show(id=nil, path=nil)
  send_request_for_id path, :get, id
end

#update(params = {}, path = nil) ⇒ Object



38
39
40
# File 'lib/finapps_core/rest/resources.rb', line 38

def update(params={}, path=nil)
  send_request path, :put, params
end