Class: Sendly::CampaignPreview

Inherits:
Object
  • Object
show all
Defined in:
lib/sendly/campaigns_resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ CampaignPreview

Returns a new instance of CampaignPreview.



81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/sendly/campaigns_resource.rb', line 81

def initialize(data)
  @id = data["id"]
  @recipient_count = data["recipient_count"] || data["recipientCount"] || 0
  @estimated_segments = data["estimated_segments"] || data["estimatedSegments"] || 0
  @estimated_credits = data["estimated_credits"] || data["estimatedCredits"] || 0
  @current_balance = data["current_balance"] || data["currentBalance"] || 0
  @has_enough_credits = data["has_enough_credits"] || data["hasEnoughCredits"] || false
  @breakdown = data["breakdown"]
  @blocked_count = data["blocked_count"] || data["blockedCount"]
  @sendable_count = data["sendable_count"] || data["sendableCount"]
  @warnings = data["warnings"]
  @messaging_profile = data["messaging_profile"] || data["messagingProfile"]
end

Instance Attribute Details

#blocked_countObject (readonly)

Returns the value of attribute blocked_count.



77
78
79
# File 'lib/sendly/campaigns_resource.rb', line 77

def blocked_count
  @blocked_count
end

#breakdownObject (readonly)

Returns the value of attribute breakdown.



77
78
79
# File 'lib/sendly/campaigns_resource.rb', line 77

def breakdown
  @breakdown
end

#current_balanceObject (readonly)

Returns the value of attribute current_balance.



77
78
79
# File 'lib/sendly/campaigns_resource.rb', line 77

def current_balance
  @current_balance
end

#estimated_creditsObject (readonly)

Returns the value of attribute estimated_credits.



77
78
79
# File 'lib/sendly/campaigns_resource.rb', line 77

def estimated_credits
  @estimated_credits
end

#estimated_segmentsObject (readonly)

Returns the value of attribute estimated_segments.



77
78
79
# File 'lib/sendly/campaigns_resource.rb', line 77

def estimated_segments
  @estimated_segments
end

#has_enough_creditsObject (readonly)

Returns the value of attribute has_enough_credits.



77
78
79
# File 'lib/sendly/campaigns_resource.rb', line 77

def has_enough_credits
  @has_enough_credits
end

#idObject (readonly)

Returns the value of attribute id.



77
78
79
# File 'lib/sendly/campaigns_resource.rb', line 77

def id
  @id
end

#messaging_profileObject (readonly)

Returns the value of attribute messaging_profile.



77
78
79
# File 'lib/sendly/campaigns_resource.rb', line 77

def messaging_profile
  @messaging_profile
end

#recipient_countObject (readonly)

Returns the value of attribute recipient_count.



77
78
79
# File 'lib/sendly/campaigns_resource.rb', line 77

def recipient_count
  @recipient_count
end

#sendable_countObject (readonly)

Returns the value of attribute sendable_count.



77
78
79
# File 'lib/sendly/campaigns_resource.rb', line 77

def sendable_count
  @sendable_count
end

#warningsObject (readonly)

Returns the value of attribute warnings.



77
78
79
# File 'lib/sendly/campaigns_resource.rb', line 77

def warnings
  @warnings
end

Instance Method Details

#enough_credits?Boolean

Returns:

  • (Boolean)


95
96
97
# File 'lib/sendly/campaigns_resource.rb', line 95

def enough_credits?
  has_enough_credits
end