Class: FinApps::REST::Consumers

Inherits:
FinAppsCore::REST::Resources
  • Object
show all
Includes:
Utils::QueryBuilder
Defined in:
lib/finapps/rest/consumers.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods included from Utils::QueryBuilder

#build_query_path

Instance Method Details

#create(params) ⇒ FinApps::REST::User, Array<String>

Parameters:

  • public_id (String)

Returns:

  • (FinApps::REST::User, Array<String>)


11
12
13
14
# File 'lib/finapps/rest/consumers.rb', line 11

def create(params)
  not_blank(params, :params)
  super params
end

#destroy(public_id) ⇒ Object



39
40
41
42
# File 'lib/finapps/rest/consumers.rb', line 39

def destroy(public_id)
  not_blank(public_id, :public_id)
  super public_id
end

#list(params = nil) ⇒ Object



16
17
18
19
20
21
# File 'lib/finapps/rest/consumers.rb', line 16

def list(params = nil)
  return super if params.nil?
  fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash

  super build_query_path(end_point, params)
end

#show(public_id) ⇒ Object



23
24
25
26
# File 'lib/finapps/rest/consumers.rb', line 23

def show(public_id)
  not_blank(public_id, :public_id)
  super public_id
end

#update(public_id, params) ⇒ Array<String>

Parameters:

  • params (Hash)

Returns:

  • (Array<String>)


30
31
32
33
34
35
36
37
# File 'lib/finapps/rest/consumers.rb', line 30

def update(public_id, params)
  not_blank(public_id, :public_id)
  not_blank(params, :params)

  path =
    "#{end_point}/#{ERB::Util.url_encode(public_id)}#{'/password' if password_update?(params)}"
  super params, path
end