Class: Kentaa::Api::Resources::RecurringDonor
- Inherits:
-
Resource
show all
- Defined in:
- lib/kentaa/api/resources/recurring_donor.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
#active? ⇒ Boolean
78
79
80
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 78
def active?
data[:active]
end
|
#amount ⇒ Object
86
87
88
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 86
def amount
BigDecimal(data[:amount])
end
|
#anonymous? ⇒ Boolean
54
55
56
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 54
def anonymous?
data[:anonymous]
end
|
#company ⇒ Object
50
51
52
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 50
def company
data[:company]
end
|
#currency ⇒ Object
82
83
84
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 82
def currency
data[:currency]
end
|
30
31
32
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 30
def donation_form_id
data[:donation_form_id]
end
|
#email ⇒ Object
58
59
60
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 58
def email
data[:email]
end
|
#end_date ⇒ Object
74
75
76
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 74
def end_date
Date.parse(data[:end_date]) if data[:end_date]
end
|
#first_name ⇒ Object
34
35
36
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 34
def first_name
data[:first_name]
end
|
#frequency_type ⇒ Object
66
67
68
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 66
def frequency_type
data[:frequency_type]
end
|
#infix ⇒ Object
38
39
40
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 38
def infix
data[:infix]
end
|
#last_name ⇒ Object
42
43
44
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 42
def last_name
data[:last_name]
end
|
#locale ⇒ Object
62
63
64
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 62
def locale
data[:locale]
end
|
#name ⇒ Object
46
47
48
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 46
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/recurring_donor.rb', line 10
def object_key
"RecurringDonor_#{id}"
end
|
#site ⇒ Object
22
23
24
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 22
def site
Kentaa::Api::Resources::Site.new(config, id: site_id, options: options)
end
|
#site_id ⇒ Object
26
27
28
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 26
def site_id
data[:site_id]
end
|
#start_date ⇒ Object
70
71
72
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 70
def start_date
Date.parse(data[:start_date])
end
|
#total_amount ⇒ Object
94
95
96
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 94
def total_amount
BigDecimal(data[:total_amount])
end
|
#transaction_costs ⇒ Object
90
91
92
|
# File 'lib/kentaa/api/resources/recurring_donor.rb', line 90
def transaction_costs
BigDecimal(data[:transaction_costs]) if data[:transaction_costs]
end
|