Class: Pushkin::TokenResult

Inherits:
ApplicationRecord show all
Defined in:
app/models/pushkin/token_result.rb

Constant Summary collapse

STATUS_SUCCESS =
"success"
STATUS_INVALID =
"invalid"
STATUS_ERROR =
"error"

Instance Method Summary collapse

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'app/models/pushkin/token_result.rb', line 34

def error?
  self.status == STATUS_ERROR
end

#invalid?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'app/models/pushkin/token_result.rb', line 30

def invalid?
  self.status == STATUS_INVALID
end

#set_error(error) ⇒ Object



21
22
23
24
# File 'app/models/pushkin/token_result.rb', line 21

def set_error(error)
  self.status = STATUS_ERROR
  self.error = error
end

#set_invalidObject



17
18
19
# File 'app/models/pushkin/token_result.rb', line 17

def set_invalid
  self.status = STATUS_INVALID
end

#set_successObject



13
14
15
# File 'app/models/pushkin/token_result.rb', line 13

def set_success
  self.status = STATUS_SUCCESS
end

#success?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'app/models/pushkin/token_result.rb', line 26

def success?
  self.status == STATUS_SUCCESS
end