Class: Papapi::Affiliate
- Inherits:
-
Object
- Object
- Papapi::Affiliate
- Defined in:
- lib/papapi/affiliate.rb
Defined Under Namespace
Classes: Commission
Instance Method Summary collapse
- #[](key) ⇒ Object
- #id ⇒ Object
-
#initialize(session) ⇒ Affiliate
constructor
A new instance of Affiliate.
- #load ⇒ Object
Constructor Details
#initialize(session) ⇒ Affiliate
Returns a new instance of Affiliate.
6 7 8 9 10 |
# File 'lib/papapi/affiliate.rb', line 6 def initialize(session) @session = session raise "Affiliate session is required" if !@session.is_affiliate? @response = nil end |
Instance Method Details
#[](key) ⇒ Object
22 23 24 |
# File 'lib/papapi/affiliate.rb', line 22 def [] (key) fields[key.to_sym] end |
#id ⇒ Object
18 19 20 |
# File 'lib/papapi/affiliate.rb', line 18 def id @response ? @response[:userid] : nil end |
#load ⇒ Object
12 13 14 15 16 |
# File 'lib/papapi/affiliate.rb', line 12 def load data = Papapi::FormRequest.new('Pap_Affiliates_Profile_PersonalDetailsForm', 'load', affiliate_session) @response = request.send self end |