A corporation manager and dashboard for EVE Online
25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- require 'eaal'
-
- class User < ActiveRecord::Base
- has_secure_password
-
- def char_names
- ensure_api_user
- begin
- @api.Characters.characters.map { |char| char.name }
- rescue EAAL::EAALError
- []
- end
- end
-
- def member_of?(corp_id)
- ensure_api_user
- @api.scope = 'char'
- begin
- @api.CharacterSheet(names: name).corporationID.to_i == corp_id
- rescue EAAL::EAALError
- false
- end
- end
-
- private
- def ensure_api_user
- @api ||= EAAL::API.new(api_key, api_verify)
- end
- end
|