Module: RallyUp::Partner
- Includes:
- RallyUp
- Defined in:
- lib/rally_up/partner.rb,
lib/rally_up/partner/user.rb,
lib/rally_up/partner/token.rb,
lib/rally_up/partner/campaign.rb,
lib/rally_up/partner/organization.rb,
lib/rally_up/partner/campaign_item.rb
Defined Under Namespace
Classes: Campaign, CampaignItem, Organization, Token, User
Constant Summary
Constants included from RallyUp
Class Attribute Summary collapse
-
.domain ⇒ Object
Returns the value of attribute domain.
-
.login ⇒ Object
Returns the value of attribute login.
-
.secret ⇒ Object
Returns the value of attribute secret.
-
.token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
- .request(method, path, domain: RallyUp::Partner.domain, params: {}, headers: {}) ⇒ Object
- .set_token ⇒ Object
Methods included from RallyUp
Class Attribute Details
.domain ⇒ Object
Returns the value of attribute domain.
8 9 10 |
# File 'lib/rally_up/partner.rb', line 8 def domain @domain end |
.login ⇒ Object
Returns the value of attribute login.
8 9 10 |
# File 'lib/rally_up/partner.rb', line 8 def login @login end |
.secret ⇒ Object
Returns the value of attribute secret.
8 9 10 |
# File 'lib/rally_up/partner.rb', line 8 def secret @secret end |
.token ⇒ Object
Returns the value of attribute token.
8 9 10 |
# File 'lib/rally_up/partner.rb', line 8 def token @token end |
Class Method Details
.request(method, path, domain: RallyUp::Partner.domain, params: {}, headers: {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rally_up/partner.rb', line 10 def request(method, path, domain: RallyUp::Partner.domain, params: {}, headers: {}) set_token if RallyUp::Partner.token.nil? || RallyUp::Partner.token.expired? super( method, path, domain: domain, params: params, headers: headers.merge( 'Authorization' => "Bearer #{RallyUp::Partner.token.access_token}", 'Content-Type' => 'application/x-www-form-urlencoded' ) ) end |