Class: JustGiving::User

Inherits:
Object
  • Object
show all
Defined in:
lib/just_giving/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_client, email) ⇒ User

Returns a new instance of User.



7
8
9
10
# File 'lib/just_giving/user.rb', line 7

def initialize(http_client, email)
  @http_client = http_client
  @email       = email
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



5
6
7
# File 'lib/just_giving/user.rb', line 5

def email
  @email
end

Instance Method Details

#fundraising_pagesObject



12
13
14
15
16
17
# File 'lib/just_giving/user.rb', line 12

def fundraising_pages
  response = @http_client.get("/account/#{CGI.escape(@email)}/pages")
  @pages = response.map do |page_hash|
    FundraisingPage.new(page_hash)
  end
end