Class: FinApps::REST::Portfolios
- Inherits:
-
FinAppsCore::REST::Resources
- Object
- FinAppsCore::REST::Resources
- FinApps::REST::Portfolios
- Includes:
- Utils::QueryBuilder
- Defined in:
- lib/finapps/rest/portfolios.rb
Instance Method Summary collapse
- #create(params) ⇒ Object
- #destroy(id) ⇒ Object
- #list(params = nil) ⇒ Object
- #show(id) ⇒ Object
- #update(id, params) ⇒ Object
Methods included from Utils::QueryBuilder
Instance Method Details
#create(params) ⇒ Object
20 21 22 23 |
# File 'lib/finapps/rest/portfolios.rb', line 20 def create(params) not_blank(params, :params) super params end |
#destroy(id) ⇒ Object
34 35 36 37 38 |
# File 'lib/finapps/rest/portfolios.rb', line 34 def destroy(id) not_blank(id, :id) super end |
#list(params = nil) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/finapps/rest/portfolios.rb', line 8 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(id) ⇒ Object
15 16 17 18 |
# File 'lib/finapps/rest/portfolios.rb', line 15 def show(id) not_blank(id, :id) super end |
#update(id, params) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/finapps/rest/portfolios.rb', line 25 def update(id, params) not_blank(id, :id) not_blank(params, :params) path = "#{end_point}/#{ERB::Util.url_encode(id)}" super params, path end |