Class: Megaplan::Deal

Inherits:
Api
  • Object
show all
Defined in:
lib/megaplan/deal.rb

Instance Attribute Summary

Attributes inherited from Api

#endpoint, #login, #password

Class Method Summary collapse

Methods inherited from Api

#auth_params, #auth_path, #authenticate, bad_response, card, check_response, create, #create_signature, custom_get, custom_post, delete, edit, #get_headers, #initial_path, #initialize, list, make_get_req, make_post_req, parsed_body, query_path, resource_path, save, to_query

Constructor Details

This class inherits a constructor from Megaplan::Api

Class Method Details

.class_endpointObject



7
8
9
# File 'lib/megaplan/deal.rb', line 7

def class_endpoint
  "/BumsTradeApiV01/Deal/"
end

.find(client, query) ⇒ Object



11
12
13
14
15
# File 'lib/megaplan/deal.rb', line 11

def find(client, query)
  scope = list(client)
  @arr = scope['deals']
  super
end

.list_fields(client, query = {}) ⇒ Object



21
22
23
# File 'lib/megaplan/deal.rb', line 21

def list_fields(client, query = {})
  custom_get(client, class_endpoint + "listFields.api", query)['Fields'] rescue []
end

.programs(client, query = {}) ⇒ Object



17
18
19
# File 'lib/megaplan/deal.rb', line 17

def programs(client, query = {})
  custom_get(client, "/BumsTradeApiV01/Program/list.api", query)['programs'] rescue []
end