Class: Snapcat::Snap::Status
- Inherits:
-
Object
- Object
- Snapcat::Snap::Status
- Defined in:
- lib/snapcat/snap.rb
Constant Summary collapse
- NONE =
-1- SENT =
0- DELIVERED =
1- OPENED =
2- SCREENSHOT =
3
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
- #delivered? ⇒ Boolean
-
#initialize(code) ⇒ Status
constructor
A new instance of Status.
- #none? ⇒ Boolean
- #opened? ⇒ Boolean
- #screenshot? ⇒ Boolean
- #sent? ⇒ Boolean
Constructor Details
#initialize(code) ⇒ Status
Returns a new instance of Status.
55 56 57 |
# File 'lib/snapcat/snap.rb', line 55 def initialize(code) @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
53 54 55 |
# File 'lib/snapcat/snap.rb', line 53 def code @code end |
Instance Method Details
#delivered? ⇒ Boolean
59 60 61 |
# File 'lib/snapcat/snap.rb', line 59 def delivered? @code == DELIVERED end |
#none? ⇒ Boolean
75 76 77 |
# File 'lib/snapcat/snap.rb', line 75 def none? @code == NONE end |
#opened? ⇒ Boolean
63 64 65 |
# File 'lib/snapcat/snap.rb', line 63 def opened? @code == OPENED end |
#screenshot? ⇒ Boolean
71 72 73 |
# File 'lib/snapcat/snap.rb', line 71 def screenshot? @code == SCREENSHOT end |
#sent? ⇒ Boolean
67 68 69 |
# File 'lib/snapcat/snap.rb', line 67 def sent? @code == SENT end |