Method: Reve::API#initialize

Defined in:
lib/reve.rb

#initialize(userid = "", key = "", charid = "") ⇒ API

Create a new API instance. current_time and cached_until are meaningful only for the LAST call made. Expects:

  • userid ( Integer | String ) - Your API userID

  • key ( String ) - Your API key (Full key or restricted key)

  • charid ( Integer | String ) - Default characterID for calls requiring it.

NOTE: All values passed to the constructor are typecasted to a String for safety.



116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/reve.rb', line 116

def initialize(userid = "", key = "", charid = "")
  @userid = (userid || "").to_s
  @key    = (key    || "").to_s
  @charid = (charid || "").to_s
  
  @save_path = nil

  @http_user_agent = "Reve"
  @max_tries = 3

  @current_time = nil
  @cached_until = nil
  @last_hash = nil
end