class JustGiving::Fundraising

Public Class Methods

new(short_name=nil) click to toggle source
# File lib/just_giving/fundraising.rb, line 3
def initialize(short_name=nil)
  @short_name = short_name
end

Public Instance Methods

create(params) click to toggle source

Create a new fundraising page

# File lib/just_giving/fundraising.rb, line 13
def create(params)
  put("v1/fundraising/pages", {:basic_auth => true}.merge(params))
end
donations(page=1, per_page=50) click to toggle source

Get all donations per page

# File lib/just_giving/fundraising.rb, line 33
def donations(page=1, per_page=50)
  get("v1/fundraising/pages/#{@short_name}/donations?pageNum=#{page}&page_size=#{per_page}",
    :basic_auth => true)
end
page() click to toggle source

Get a specific page

# File lib/just_giving/fundraising.rb, line 28
def page
  get("v1/fundraising/pages/#{@short_name}")
end
pages() click to toggle source

Get all pages

# File lib/just_giving/fundraising.rb, line 8
def pages
  get("v1/fundraising/pages", :basic_auth => true)
end
short_name_registered?() click to toggle source

Check if a short name is registered

# File lib/just_giving/fundraising.rb, line 18
def short_name_registered?
  begin
    head("v1/fundraising/pages/#{@short_name}")
    return true
  rescue JustGiving::NotFound
    return false
  end
end
suggest() click to toggle source
# File lib/just_giving/fundraising.rb, line 47
def suggest
  # TODO
end
update_story(story) click to toggle source

Update a pages story

# File lib/just_giving/fundraising.rb, line 39
def update_story(story)
  post("v1/fundraising/pages/#{@short_name}", {:basic_auth => true}.merge({:storySupplement => story}))
end
upload_image() click to toggle source
# File lib/just_giving/fundraising.rb, line 43
def upload_image
  # TODO
end