Exception: Shai::DeviceFlowError

Inherits:
Error
  • Object
show all
Defined in:
lib/shai.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_code, interval: nil) ⇒ DeviceFlowError

Returns a new instance of DeviceFlowError.



37
38
39
40
41
# File 'lib/shai.rb', line 37

def initialize(error_code, interval: nil)
  @error_code = error_code
  @interval = interval
  super(error_code)
end

Instance Attribute Details

#error_code ⇒ Object (readonly)

Returns the value of attribute error_code.



35
36
37
# File 'lib/shai.rb', line 35

def error_code
  @error_code
end

#interval ⇒ Object (readonly)

Returns the value of attribute interval.



35
36
37
# File 'lib/shai.rb', line 35

def interval
  @interval
end

Instance Method Details

#access_denied? ⇒ Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/shai.rb', line 51

def access_denied?
  error_code == "access_denied"
end

#authorization_pending? ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/shai.rb', line 43

def authorization_pending?
  error_code == "authorization_pending"
end

#expired? ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/shai.rb', line 55

def expired?
  error_code == "expired_token"
end

#slow_down? ⇒ Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/shai.rb', line 47

def slow_down?
  error_code == "slow_down"
end