Class: ConstantContact::Components::TrackingActivity

Inherits:
Component
  • Object
show all
Defined in:
lib/constantcontact/components/tracking/tracking_activity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Component

#to_hash, to_hash_value, #to_json

Constructor Details

#initialize(results, pagination) ⇒ TrackingActivity

Constructor to create a TrackingActivity from the results/pagination response from getting a set of activities

Parameters:

  • results (Array)
    • results array from a tracking endpoint

  • pagination (Hash)
    • pagination hash returned from a tracking endpoint



17
18
19
20
21
22
23
# File 'lib/constantcontact/components/tracking/tracking_activity.rb', line 17

def initialize(results, pagination)
  @results = results

  if (pagination.has_key?('next'))
    @next = pagination['next'][pagination['next'].index('&next=') + 6, pagination['next'].length]
  end
end

Instance Attribute Details

#nextObject

Returns the value of attribute next



10
11
12
# File 'lib/constantcontact/components/tracking/tracking_activity.rb', line 10

def next
  @next
end

#resultsObject

Returns the value of attribute results



10
11
12
# File 'lib/constantcontact/components/tracking/tracking_activity.rb', line 10

def results
  @results
end