Sha256: 0516d26b2f80fc35c34f2d9f321de36e61364d99df6a8fe923681b15ff600205
Contents?: true
Size: 1.19 KB
Versions: 1
Compression:
Stored size: 1.19 KB
Contents
module EveOnline class Character attr_reader :options def initialize(options = {}) @options = options end def as_json(*args) { character_id: character_id, character_name: character_name, corporation_id: corporation_id, corporation_name: corporation_name, alliance_id: alliance_id, alliance_name: alliance_name, faction_id: faction_id, faction_name: faction_name } end def character_id @character_id ||= options.fetch('@characterID').to_i end def character_name @name = @name || options.fetch('@name', nil) || options.fetch('@characterName') end def corporation_id @corporation_id ||= options.fetch('@corporationID').to_i end def corporation_name @corporation_name ||= options.fetch('@corporationName') end def alliance_id @alliance_id ||= options.fetch('@allianceID').to_i end def alliance_name @alliance_name ||= options.fetch('@allianceName') end def faction_id @faction_id ||= options.fetch('@factionID').to_i end def faction_name @faction_name ||= options.fetch('@factionName') end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
eve_online-0.4.0 | lib/eve_online/character.rb |