Class: Sendly::CampaignPreview
- Inherits:
-
Object
- Object
- Sendly::CampaignPreview
- Defined in:
- lib/sendly/campaigns_resource.rb
Instance Attribute Summary collapse
-
#blocked_count ⇒ Object
readonly
Returns the value of attribute blocked_count.
-
#breakdown ⇒ Object
readonly
Returns the value of attribute breakdown.
-
#current_balance ⇒ Object
readonly
Returns the value of attribute current_balance.
-
#estimated_credits ⇒ Object
readonly
Returns the value of attribute estimated_credits.
-
#estimated_segments ⇒ Object
readonly
Returns the value of attribute estimated_segments.
-
#has_enough_credits ⇒ Object
readonly
Returns the value of attribute has_enough_credits.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#messaging_profile ⇒ Object
readonly
Returns the value of attribute messaging_profile.
-
#recipient_count ⇒ Object
readonly
Returns the value of attribute recipient_count.
-
#sendable_count ⇒ Object
readonly
Returns the value of attribute sendable_count.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
- #enough_credits? ⇒ Boolean
-
#initialize(data) ⇒ CampaignPreview
constructor
A new instance of CampaignPreview.
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_count ⇒ Object (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 |
#breakdown ⇒ Object (readonly)
Returns the value of attribute breakdown.
77 78 79 |
# File 'lib/sendly/campaigns_resource.rb', line 77 def breakdown @breakdown end |
#current_balance ⇒ Object (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_credits ⇒ Object (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_segments ⇒ Object (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_credits ⇒ Object (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 |
#id ⇒ Object (readonly)
Returns the value of attribute id.
77 78 79 |
# File 'lib/sendly/campaigns_resource.rb', line 77 def id @id end |
#messaging_profile ⇒ Object (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_count ⇒ Object (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_count ⇒ Object (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 |
#warnings ⇒ Object (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
95 96 97 |
# File 'lib/sendly/campaigns_resource.rb', line 95 def enough_credits? has_enough_credits end |