Class: Snapcat::Snap::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/snapcat/snap.rb

Constant Summary collapse

NONE =
-1
SENT =
0
DELIVERED =
1
OPENED =
2
SCREENSHOT =
3

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (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

Returns:

  • (Boolean)


59
60
61
# File 'lib/snapcat/snap.rb', line 59

def delivered?
  @code == DELIVERED
end

#none?Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/snapcat/snap.rb', line 75

def none?
  @code == NONE
end

#opened?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/snapcat/snap.rb', line 63

def opened?
  @code == OPENED
end

#screenshot?Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/snapcat/snap.rb', line 71

def screenshot?
  @code == SCREENSHOT
end

#sent?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/snapcat/snap.rb', line 67

def sent?
  @code == SENT
end