Class: Snapcat::Friend::Type

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

Constant Summary collapse

CONFIRMED =
0
UNCONFIRMED =
1
BLOCKED =
2
DELETED =
3

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ Type

Returns a new instance of Type.



36
37
38
# File 'lib/snapcat/friend.rb', line 36

def initialize(code)
  @code = code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



34
35
36
# File 'lib/snapcat/friend.rb', line 34

def code
  @code
end

Instance Method Details

#blocked?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/snapcat/friend.rb', line 40

def blocked?
  @code == BLOCKED
end

#confirmed?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/snapcat/friend.rb', line 44

def confirmed?
  @code == CONFIRMED
end

#deleted?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/snapcat/friend.rb', line 48

def deleted?
  @code == DELETED
end

#unconfirmed?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/snapcat/friend.rb', line 52

def unconfirmed?
  @code == UNCONFIRMED
end