Class: Postmark::Bounce
- Inherits:
-
Object
- Object
- Postmark::Bounce
- Defined in:
- lib/postmark/bounce.rb
Instance Attribute Summary collapse
-
#bounced_at ⇒ Object
readonly
Returns the value of attribute bounced_at.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#message_id ⇒ Object
readonly
Returns the value of attribute message_id.
-
#message_stream ⇒ Object
readonly
Returns the value of attribute message_stream.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#server_id ⇒ Object
readonly
Returns the value of attribute server_id.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #activate ⇒ Object
- #can_activate? ⇒ Boolean
- #dump ⇒ Object
- #dump_available? ⇒ Boolean
- #inactive? ⇒ Boolean
-
#initialize(values = {}) ⇒ Bounce
constructor
A new instance of Bounce.
Constructor Details
#initialize(values = {}) ⇒ Bounce
Returns a new instance of Bounce.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/postmark/bounce.rb', line 9 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] @server_id = values[:server_id] @message_stream = values[:message_stream] @content = values[:content] end |
Instance Attribute Details
#bounced_at ⇒ Object (readonly)
Returns the value of attribute bounced_at.
6 7 8 |
# File 'lib/postmark/bounce.rb', line 6 def bounced_at @bounced_at end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
6 7 8 |
# File 'lib/postmark/bounce.rb', line 6 def content @content end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/postmark/bounce.rb', line 6 def description @description end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
6 7 8 |
# File 'lib/postmark/bounce.rb', line 6 def details @details end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
6 7 8 |
# File 'lib/postmark/bounce.rb', line 6 def email @email end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/postmark/bounce.rb', line 6 def id @id end |
#message_id ⇒ Object (readonly)
Returns the value of attribute message_id.
6 7 8 |
# File 'lib/postmark/bounce.rb', line 6 def @message_id end |
#message_stream ⇒ Object (readonly)
Returns the value of attribute message_stream.
6 7 8 |
# File 'lib/postmark/bounce.rb', line 6 def @message_stream end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/postmark/bounce.rb', line 6 def name @name end |
#server_id ⇒ Object (readonly)
Returns the value of attribute server_id.
6 7 8 |
# File 'lib/postmark/bounce.rb', line 6 def server_id @server_id end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
6 7 8 |
# File 'lib/postmark/bounce.rb', line 6 def subject @subject end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
6 7 8 |
# File 'lib/postmark/bounce.rb', line 6 def tag @tag end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/postmark/bounce.rb', line 6 def type @type end |
Class Method Details
.all(options = {}) ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/postmark/bounce.rb', line 54 def all( = {}) [:count] ||= 30 [:offset] ||= 0 Postmark.api_client.get_bounces().map do |bounce_json| Bounce.new(bounce_json) end end |
.find(id) ⇒ Object
50 51 52 |
# File 'lib/postmark/bounce.rb', line 50 def find(id) Bounce.new(Postmark.api_client.get_bounce(id)) end |
Instance Method Details
#activate ⇒ Object
41 42 43 |
# File 'lib/postmark/bounce.rb', line 41 def activate Bounce.new(Postmark.api_client.activate_bounce(id)) end |
#can_activate? ⇒ Boolean
33 34 35 |
# File 'lib/postmark/bounce.rb', line 33 def can_activate? !!@can_activate end |
#dump ⇒ Object
37 38 39 |
# File 'lib/postmark/bounce.rb', line 37 def dump Postmark.api_client.dump_bounce(id)[:body] end |
#dump_available? ⇒ Boolean
45 46 47 |
# File 'lib/postmark/bounce.rb', line 45 def dump_available? !!@dump_available end |
#inactive? ⇒ Boolean
29 30 31 |
# File 'lib/postmark/bounce.rb', line 29 def inactive? !!@inactive end |