Class: JustGiving::User
- Inherits:
-
Object
- Object
- JustGiving::User
- Defined in:
- lib/just_giving/user.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
Instance Method Summary collapse
- #fundraising_pages ⇒ Object
-
#initialize(http_client, email) ⇒ User
constructor
A new instance of User.
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
#email ⇒ Object (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_pages ⇒ Object
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 |