Class: Kentaa::Api::Resources::DonationForm
- Inherits:
-
Resource
show all
- Defined in:
- lib/kentaa/api/resources/donation_form.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
#banners ⇒ Object
66
67
68
69
70
71
72
73
74
75
76
77
78
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 66
def banners
@banners ||= begin
banners = []
if data[:banners]
data[:banners].each do |banner|
banners << Kentaa::Api::Resources::Banner.new(banner)
end
end
banners
end
end
|
#description ⇒ Object
38
39
40
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 38
def description
data[:description]
end
|
#external_reference ⇒ Object
58
59
60
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 58
def external_reference
data[:external_reference]
end
|
#manual_donations ⇒ Object
#newsletter_subscriptions ⇒ Object
#object_key ⇒ Object
10
11
12
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 10
def object_key
"DonationForm_#{id}"
end
|
#owner ⇒ Object
30
31
32
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 30
def owner
@owner ||= Kentaa::Api::Resources::User.new(config, data: data[:owner], options: options)
end
|
#parent ⇒ Object
14
15
16
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 14
def parent
site
end
|
#published? ⇒ Boolean
50
51
52
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 50
def published?
data[:published]
end
|
#recurring_donors ⇒ Object
#site ⇒ Object
18
19
20
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 18
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/donation_form.rb', line 26
def site_id
data[:site_id]
end
|
#slug ⇒ Object
22
23
24
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 22
def slug
data[:slug]
end
|
#title ⇒ Object
34
35
36
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 34
def title
data[:title]
end
|
#total_amount ⇒ Object
42
43
44
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 42
def total_amount
BigDecimal(data[:total_amount])
end
|
#total_donations ⇒ Object
46
47
48
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 46
def total_donations
data[:total_donations]
end
|
#url ⇒ Object
62
63
64
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 62
def url
data[:url]
end
|
#visible? ⇒ Boolean
54
55
56
|
# File 'lib/kentaa/api/resources/donation_form.rb', line 54
def visible?
data[:visible]
end
|