Sha256: eb7496f150e030dbf9efc7178ecd506ba163ec5fee539650b506a81eb71737bf

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

module EveOnline
  module Account
    # http://wiki.eve-id.net/APIv2_Account_APIKeyInfo_XML
    class ApiKeyInfo < Base
      API_ENDPOINT = 'https://api.eveonline.com/account/APIKeyInfo.xml.aspx'

      def character_id
        row.fetch('@characterID').to_i
      end

      def character_name
        row.fetch('@characterName')
      end

      def corporation_id
        row.fetch('@corporationID').to_i
      end

      def corporation_name
        row.fetch('@corporationName')
      end

      def alliance_id
        row.fetch('@allianceID').to_i
      end

      def alliance_name
        row.fetch('@allianceName')
      end

      def faction_id
        row.fetch('@factionID').to_i
      end

      def faction_name
        row.fetch('@factionName')
      end

      def row
        rowset.fetch('row')
      end

      def rowset
        key.fetch('rowset')
      end

      def expires
        key.fetch('@expires')
      end

      def type
        key.fetch('@type')
      end

      def access_mask
        key.fetch('@accessMask').to_i
      end

      def key
        result.fetch('key')
      end

      def version
        eveapi.fetch('@version').to_i
      end

      def url
        "#{ API_ENDPOINT }?keyID=#{ key_id }&vCode=#{ v_code }"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eve_online-0.3.0 lib/eve_online/account/api_key_info.rb