Class: Kentaa::Api::Resources::ManualDonation
- Inherits:
-
Resource
show all
- Defined in:
- lib/kentaa/api/resources/manual_donation.rb
Instance Attribute Summary
Attributes inherited from Resource
#id
Attributes inherited from Base
#config, #endpoint_path, #options, #resource_class
Instance Method Summary
collapse
Methods inherited from Resource
#create, #created_at, #delete, #initialize, #load, #save, #updated_at
Methods inherited from Base
attribute_key, #initialize, #load, #loaded?
Instance Method Details
#action_id ⇒ Object
60
61
62
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 60
def action_id
data[:action_id]
end
|
#amount ⇒ Object
96
97
98
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 96
def amount
BigDecimal(data[:amount])
end
|
#anonymous? ⇒ Boolean
80
81
82
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 80
def anonymous?
data[:anonymous]
end
|
#company_id ⇒ Object
48
49
50
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 48
def company_id
data[:company_id]
end
|
#countable? ⇒ Boolean
100
101
102
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 100
def countable?
data[:countable]
end
|
#currency ⇒ Object
92
93
94
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 92
def currency
data[:currency]
end
|
40
41
42
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 40
def donation_form_id
data[:donation_form_id]
end
|
#email ⇒ Object
84
85
86
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 84
def email
data[:email]
end
|
#entity ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 14
def entity
if action_id
Kentaa::Api::Resources::Action.new(config, id: action_id, options: options)
elsif team_id
Kentaa::Api::Resources::Team.new(config, id: team_id, options: options)
elsif company_id
Kentaa::Api::Resources::Company.new(config, id: company_id, options: options)
elsif project_id
Kentaa::Api::Resources::Project.new(config, id: project_id, options: options)
elsif segment_id
Kentaa::Api::Resources::Segment.new(config, id: segment_id, options: options)
elsif donation_form_id
Kentaa::Api::Resources::DonationForm.new(config, id: donation_form_id, options: options)
else
Kentaa::Api::Resources::Site.new(config, id: site_id, options: options)
end
end
|
#first_name ⇒ Object
64
65
66
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 64
def first_name
data[:first_name]
end
|
#infix ⇒ Object
68
69
70
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 68
def infix
data[:infix]
end
|
#last_name ⇒ Object
72
73
74
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 72
def last_name
data[:last_name]
end
|
#message ⇒ Object
88
89
90
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 88
def message
data[:message]
end
|
#name ⇒ Object
76
77
78
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 76
def name
[first_name, infix, last_name].reject { |s| s.to_s.empty? }.join(' ')
end
|
#object_key ⇒ Object
10
11
12
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 10
def object_key
"Donation_#{id}"
end
|
#project_id ⇒ Object
52
53
54
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 52
def project_id
data[:project_id]
end
|
#segment_id ⇒ Object
44
45
46
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 44
def segment_id
data[:segment_id]
end
|
#site ⇒ Object
32
33
34
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 32
def site
Kentaa::Api::Resources::Site.new(config, id: site_id, options: options)
end
|
#site_id ⇒ Object
36
37
38
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 36
def site_id
data[:site_id]
end
|
#target_url ⇒ Object
104
105
106
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 104
def target_url
data[:target_url]
end
|
#team_id ⇒ Object
56
57
58
|
# File 'lib/kentaa/api/resources/manual_donation.rb', line 56
def team_id
data[:team_id]
end
|