class Telegram::Auth::Configuration

Attributes

auth_expires_in[RW]
token[RW]

Public Instance Methods

reset!() click to toggle source
# File lib/telegram/auth/configuration.rb, line 24
def reset!
  self.token = nil
  self.auth_expires_in = nil
end
valid?() click to toggle source
# File lib/telegram/auth/configuration.rb, line 9
def valid?
  @errors = []
  @errors << ConfigurationError.new("Invalid token") if (!token || token.empty?)
  @errors.none?
end
validate!() click to toggle source
# File lib/telegram/auth/configuration.rb, line 15
def validate!
  valid? or raise @errors.first
end
verify!() click to toggle source
# File lib/telegram/auth/configuration.rb, line 19
def verify!
  return true if valid?
  raise @errors.shift
end