Class: RallyUp::Partner::Campaign
- Inherits:
-
Object
- Object
- RallyUp::Partner::Campaign
- Defined in:
- lib/rally_up/partner/campaign.rb
Instance Attribute Summary collapse
-
#amount_goal ⇒ Object
Returns the value of attribute amount_goal.
-
#amount_raised ⇒ Object
Returns the value of attribute amount_raised.
-
#amount_raised_in_period ⇒ Object
Returns the value of attribute amount_raised_in_period.
-
#campaign_setup_url ⇒ Object
Returns the value of attribute campaign_setup_url.
-
#campaign_status ⇒ Object
Returns the value of attribute campaign_status.
-
#cta_label ⇒ Object
Returns the value of attribute cta_label.
-
#currency_symbol ⇒ Object
Returns the value of attribute currency_symbol.
-
#end_date_utc ⇒ Object
Returns the value of attribute end_date_utc.
-
#fund_code ⇒ Object
Returns the value of attribute fund_code.
-
#fundraising_activity_type ⇒ Object
Returns the value of attribute fundraising_activity_type.
-
#goal_period ⇒ Object
Returns the value of attribute goal_period.
-
#id ⇒ Object
Returns the value of attribute id.
-
#management_pages ⇒ Object
Returns the value of attribute management_pages.
-
#name ⇒ Object
Returns the value of attribute name.
-
#organization_id ⇒ Object
Returns the value of attribute organization_id.
-
#organization_name ⇒ Object
Returns the value of attribute organization_name.
-
#primary_currency ⇒ Object
Returns the value of attribute primary_currency.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#start_date_utc ⇒ Object
Returns the value of attribute start_date_utc.
-
#thumbnail_url ⇒ Object
Returns the value of attribute thumbnail_url.
-
#time_remaining_minutes ⇒ Object
Returns the value of attribute time_remaining_minutes.
-
#timezone_name ⇒ Object
Returns the value of attribute timezone_name.
-
#total_supporters ⇒ Object
Returns the value of attribute total_supporters.
-
#total_views ⇒ Object
Returns the value of attribute total_views.
-
#url ⇒ Object
Returns the value of attribute url.
-
#utcoffset_minutes ⇒ Object
Returns the value of attribute utcoffset_minutes.
Class Method Summary collapse
- .list(organization_id:, start_date: nil, end_date: nil, sort_by: nil, campaign_type: nil, include_donation_pages: nil, status: nil) ⇒ Object
- .retrieve(id) ⇒ Object
Instance Method Summary collapse
-
#initialize(json) ⇒ Campaign
constructor
A new instance of Campaign.
Constructor Details
#initialize(json) ⇒ Campaign
Returns a new instance of Campaign.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rally_up/partner/campaign.rb', line 15 def initialize(json) @id = json[:Id] @name = json[:Name] @url = json[:Url] @campaign_setup_url = json[:CampaignSetupUrl] @campaign_status = json[:CampaignStatus] @start_date_utc = json[:StartDateUtc] @end_date_utc = json[:EndDateUtc] @amount_raised = json[:AmountRaised] @amount_raised_in_period = json[:AmountRaisedInPeriod] @amount_goal = json[:AmountGoal] @goal_period = json[:GoalPeriod] @total_views = json[:TotalViews] @total_supporters = json[:TotalSupporters] @organization_id = json[:OrganizationId] @organization_name = json[:OrganizationName] @timezone_name = json[:TimezoneName] @utcoffset_minutes = json[:UtcOffsetMinutes] @time_remaining_minutes = json[:TimeRemainingMinutes] @thumbnail_url = json[:ThumbnailUrl] @cta_label = json[:CtaLabel] @management_pages = json[:ManagementPages] @primary_currency = json[:PrimaryCurrency] @currency_symbol = json[:CurrencySymbol] @project_id = json[:ProjectId] @fund_code = json[:FundCode] @fundraising_activity_type = json[:FundraisingActivityType] end |
Instance Attribute Details
#amount_goal ⇒ Object
Returns the value of attribute amount_goal.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def amount_goal @amount_goal end |
#amount_raised ⇒ Object
Returns the value of attribute amount_raised.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def amount_raised @amount_raised end |
#amount_raised_in_period ⇒ Object
Returns the value of attribute amount_raised_in_period.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def amount_raised_in_period @amount_raised_in_period end |
#campaign_setup_url ⇒ Object
Returns the value of attribute campaign_setup_url.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def campaign_setup_url @campaign_setup_url end |
#campaign_status ⇒ Object
Returns the value of attribute campaign_status.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def campaign_status @campaign_status end |
#cta_label ⇒ Object
Returns the value of attribute cta_label.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def cta_label @cta_label end |
#currency_symbol ⇒ Object
Returns the value of attribute currency_symbol.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def currency_symbol @currency_symbol end |
#end_date_utc ⇒ Object
Returns the value of attribute end_date_utc.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def end_date_utc @end_date_utc end |
#fund_code ⇒ Object
Returns the value of attribute fund_code.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def fund_code @fund_code end |
#fundraising_activity_type ⇒ Object
Returns the value of attribute fundraising_activity_type.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def fundraising_activity_type @fundraising_activity_type end |
#goal_period ⇒ Object
Returns the value of attribute goal_period.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def goal_period @goal_period end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def id @id end |
#management_pages ⇒ Object
Returns the value of attribute management_pages.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def management_pages @management_pages end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def name @name end |
#organization_id ⇒ Object
Returns the value of attribute organization_id.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def organization_id @organization_id end |
#organization_name ⇒ Object
Returns the value of attribute organization_name.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def organization_name @organization_name end |
#primary_currency ⇒ Object
Returns the value of attribute primary_currency.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def primary_currency @primary_currency end |
#project_id ⇒ Object
Returns the value of attribute project_id.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def project_id @project_id end |
#start_date_utc ⇒ Object
Returns the value of attribute start_date_utc.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def start_date_utc @start_date_utc end |
#thumbnail_url ⇒ Object
Returns the value of attribute thumbnail_url.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def thumbnail_url @thumbnail_url end |
#time_remaining_minutes ⇒ Object
Returns the value of attribute time_remaining_minutes.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def time_remaining_minutes @time_remaining_minutes end |
#timezone_name ⇒ Object
Returns the value of attribute timezone_name.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def timezone_name @timezone_name end |
#total_supporters ⇒ Object
Returns the value of attribute total_supporters.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def total_supporters @total_supporters end |
#total_views ⇒ Object
Returns the value of attribute total_views.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def total_views @total_views end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def url @url end |
#utcoffset_minutes ⇒ Object
Returns the value of attribute utcoffset_minutes.
6 7 8 |
# File 'lib/rally_up/partner/campaign.rb', line 6 def utcoffset_minutes @utcoffset_minutes end |
Class Method Details
.list(organization_id:, start_date: nil, end_date: nil, sort_by: nil, campaign_type: nil, include_donation_pages: nil, status: nil) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/rally_up/partner/campaign.rb', line 45 def list( organization_id:, # required start_date: nil, # optional end_date: nil, # optional sort_by: nil, # optional campaign_type: nil, # optional include_donation_pages: nil, # optional status: nil # optional ) json = RallyUp::Partner.json(:get, '/v1/partnerapi/campaigns', params: { organizationID: organization_id, endDate: end_date, startDate: start_date, sortBy: sort_by, campaignType: campaign_type, includeDonationPages: include_donation_pages, status: status }.reject { |_k, v| v.nil? }) RallyUp::ListObject.new(json, self) end |