Class: Investolink::Project

Inherits:
Resource show all
Includes:
Operations::Create, Operations::Update
Defined in:
lib/investolink/project.rb

Instance Attribute Summary

Attributes inherited from InvestolinkObject

#api_key, #api_token

Instance Method Summary collapse

Methods included from Operations::Update

#save

Methods included from Operations::Create

included

Methods inherited from Resource

#refresh, #resource_url, resource_url, retrieve

Methods inherited from InvestolinkObject

#[], #[]=, #as_json, construct_from, #each, #initialize, #inspect, #keys, #refresh_from, #to_hash, #to_json, #to_s, #values

Constructor Details

This class inherits a constructor from Investolink::InvestolinkObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Investolink::InvestolinkObject

Instance Method Details

#assets(params = {}) ⇒ Object



16
17
18
19
# File 'lib/investolink/project.rb', line 16

def assets(params={})
  response, api_key, api_token = Investolink.request(:get, assets_url, @api_key, @api_token, params)
  Util.convert_to_investolink_object(response, api_key, api_token)
end

#donations(params = {}) ⇒ Object



46
47
48
49
# File 'lib/investolink/project.rb', line 46

def donations(params={})
  response, api_key, api_token = Investolink.request(:get, donations_url, @api_key, @api_token, params)
  Util.convert_to_investolink_object(response, api_key, api_token)
end

#fundallocations(params = {}) ⇒ Object



36
37
38
39
# File 'lib/investolink/project.rb', line 36

def fundallocations(params={})
  response, api_key, api_token = Investolink.request(:get, fundallocations_url, @api_key, @api_token, params)
  Util.convert_to_investolink_object(response, api_key, api_token)
end

#new_asset(params) ⇒ Object



21
22
23
24
# File 'lib/investolink/project.rb', line 21

def new_asset(params)
  response, api_key, api_token = Investolink.request(:post, new_asset_url(id), @api_key, @api_token, params)
  Util.convert_to_investolink_object(response, api_key, api_token)
end

#new_donation(params) ⇒ Object



51
52
53
54
# File 'lib/investolink/project.rb', line 51

def new_donation(params)
  response, api_key, api_token = Investolink.request(:post, new_donation_url(id), @api_key, @api_token, params)
  Util.convert_to_investolink_object(response, api_key, api_token)
end

#new_fundallocation(params) ⇒ Object



41
42
43
44
# File 'lib/investolink/project.rb', line 41

def new_fundallocation(params)
  response, api_key, api_token = Investolink.request(:post, new_fundallocation_url(id), @api_key, @api_token, params)
  Util.convert_to_investolink_object(response, api_key, api_token)
end

#new_reward(params) ⇒ Object



11
12
13
14
# File 'lib/investolink/project.rb', line 11

def new_reward(params)
  response, api_key, api_token = Investolink.request(:post, new_reward_url(id), @api_key, @api_token, params)
  Util.convert_to_investolink_object(response, api_key, api_token)
end


31
32
33
34
# File 'lib/investolink/project.rb', line 31

def new_sociallink(params)
  response, api_key, api_token = Investolink.request(:post, new_sociallink_url(id), @api_key, @api_token, params)
  Util.convert_to_investolink_object(response, api_key, api_token)
end

#rewards(params = {}) ⇒ Object



6
7
8
9
# File 'lib/investolink/project.rb', line 6

def rewards(params={})
  response, api_key, api_token = Investolink.request(:get, rewards_url, @api_key, @api_token, params)
  Util.convert_to_investolink_object(response, api_key, api_token)
end


26
27
28
29
# File 'lib/investolink/project.rb', line 26

def sociallinks(params={})
  response, api_key, api_token = Investolink.request(:get, sociallinks_url, @api_key, @api_token, params)
  Util.convert_to_investolink_object(response, api_key, api_token)
end