class Postmark::Bounce

Attributes

bounced_at[R]
description[R]
details[R]
email[R]
id[R]
message_id[R]
name[R]
server_id[R]
subject[R]
tag[R]
type[R]

Public Class Methods

all(options = {}) click to toggle source
# File lib/postmark/bounce.rb, line 50
def all(options = {})
  options[:count]  ||= 30
  options[:offset] ||= 0
  Postmark.api_client.get_bounces(options).map do |bounce_json|
    Bounce.new(bounce_json)
  end
end
find(id) click to toggle source
# File lib/postmark/bounce.rb, line 46
def find(id)
  Bounce.new(Postmark.api_client.get_bounce(id))
end
new(values = {}) click to toggle source
# File lib/postmark/bounce.rb, line 8
def initialize(values = {})
  values = Postmark::HashHelper.to_ruby(values)
  @id = values[:id]
  @email = values[:email]
  @bounced_at = Time.parse(values[:bounced_at])
  @type = values[:type]
  @name = values[:name]
  @description = values[:description]
  @details = values[:details]
  @tag = values[:tag]
  @dump_available = values[:dump_available]
  @inactive = values[:inactive]
  @can_activate = values[:can_activate]
  @message_id = values[:message_id]
  @subject = values[:subject]
end

Public Instance Methods

activate() click to toggle source
# File lib/postmark/bounce.rb, line 37
def activate
  Bounce.new(Postmark.api_client.activate_bounce(id))
end
can_activate?() click to toggle source
# File lib/postmark/bounce.rb, line 29
def can_activate?
  !!@can_activate
end
dump() click to toggle source
# File lib/postmark/bounce.rb, line 33
def dump
  Postmark.api_client.dump_bounce(id)[:body]
end
dump_available?() click to toggle source
# File lib/postmark/bounce.rb, line 41
def dump_available?
  !!@dump_available
end
inactive?() click to toggle source
# File lib/postmark/bounce.rb, line 25
def inactive?
  !!@inactive
end