Permalink
Browse files

Added tax info to journal, characterName to transactions, and dob. an…

…cestry to characterSheet.
  • Loading branch information...
1 parent c5f242f commit 891bc37d9c7fbbf26bbda6050c7e3925b9836506 @rourkem rourkem committed Dec 13, 2011
Showing with 21 additions and 11 deletions.
  1. +1 −1 lib/reve.rb
  2. +9 −4 lib/reve/classes.rb
  3. +5 −3 test/test_reve.rb
  4. +3 −1 test/xml/character_sheet.xml
  5. +3 −2 test/xml/corporate_wallet_journal.xml
View
@@ -894,7 +894,7 @@ def character_sheet(opts = { :characterid => nil })
cs.enhancers << i
end
- [ 'characterID', 'name', 'race', 'bloodLine', 'gender','corporationName',
+ [ 'characterID', 'name', 'race', 'bloodLine', 'ancestry', 'dob', 'gender','corporationName',
'corporationID','balance', 'cloneName', 'cloneSkillPoints'
].each do |field|
cs.send("#{field.downcase}=",xml.search("/eveapi/result/#{field}/").first.to_s)
View
@@ -616,7 +616,7 @@ def initialize(elem) #:nodoc:
class CharacterSheet
attr_accessor :name, :race, :bloodline, :gender, :id, :corporation_name, :corporation_id, :balance
attr_accessor :intelligence, :memory, :charisma, :perception, :willpower, :clone_name, :clone_skill_points
- attr_accessor :skills, :enhancers, :roles, :certificate_ids, :corporate_titles
+ attr_accessor :skills, :enhancers, :roles, :certificate_ids, :corporate_titles, :dob, :ancestry
attr_accessor :corporationRolesAtHQ, :corporationRoles, :corporationRolesAtBase, :corporationRolesAtOther
alias_method :corporate_roles_at_hq, :corporationRolesAtHQ
alias_method :corporate_roles, :corporationRoles
@@ -1404,7 +1404,7 @@ def initialize(elem)
# * balance ( Float ) - New wallet balance after this action
# * reason ( String ) - Any reason for the action. May be blank (useful in giving ISK)
class WalletJournal
- attr_reader :date, :ref_id, :reftype_id, :owner_name1, :owner_id1, :owner_name2, :owner_id2, :arg_name1, :arg_id1, :amount, :balance, :reason
+ attr_reader :date, :ref_id, :reftype_id, :owner_name1, :owner_id1, :owner_name2, :owner_id2, :arg_name1, :arg_id1, :amount, :balance, :reason, :tax_amount, :tax_receiver_id
alias_method :id, :ref_id
def initialize(elem) #:nodoc:
@date = elem['date'].to_time
@@ -1417,6 +1417,8 @@ def initialize(elem) #:nodoc:
@arg_name1 = elem['argName1']
@arg_id1 = elem['argID1'].to_i if elem['argID1']
@amount = elem['amount'].to_f
+ @tax_amount = elem['taxAmount'].to_f
+ @tax_receiver_id = elem['taxReceiverID'].to_i if elem['taxReceiverID']
@balance = elem['balance'].to_f
@reason = elem['reason']
end
@@ -1440,7 +1442,7 @@ def initialize(elem) #:nodoc:
class WalletTransaction
attr_reader :created_at, :id, :quantity, :type_name, :type_id, :price,
:client_id, :client_name, :character_id, :station_id, :station_name, :type,
- :transaction_for
+ :transaction_for, :character_name
def initialize(elem) #:nodoc:
@created_at = elem['transactionDateTime'].to_time
@id = elem['transactionID'].to_i
@@ -1450,6 +1452,7 @@ def initialize(elem) #:nodoc:
@price = elem['price'].to_f
@client_id = elem['clientID'].to_i if elem['clientID']
@client_name = elem['clientName']
+ @character_name = elem['characterName']
@station_id = elem['stationID'].to_i
@station_name = elem['stationName']
@character_id = elem['characterID'].to_i if elem['characterID'] && elem['characterID'] != '0'
@@ -1567,14 +1570,16 @@ def initialize(elem) #:nodoc:
# * last_known_location ( String ) -
# * acount_balance ( Float )
class CharacterInfo
- attr_reader :id, :name, :race, :bloodline, :corporation_id, :corporation_name, :corporation_date, :alliance_id, :alliance_name, :alliance_date
+ attr_reader :id, :name, :race, :bloodline, :corporation_id, :corporation_name, :corporation_date, :alliance_id, :alliance_name, :alliance_date, :dob, :ancestry
attr_reader :security_status, :skillpoints, :skill_training_ends, :ship_name, :ship_type_id, :ship_type_name, :last_known_location, :acount_balance
def initialize(elem) #:nodoc:
@id = (elem/'characterID').inner_html.to_i
@name = (elem/'characterName').inner_html
+ @dob = (elem/'DoB').inner_html
@race = (elem/'race').inner_html
@bloodline = (elem/'bloodline').inner_html
+ @ancestry = (elem/'ancestry').inner_html
@corporation_id = (elem/'corporationID').inner_html.to_i
@corporation_name = (elem/'corporation').inner_html
@corporation_date = Time.parse((elem/'corporationDate').inner_html)
View
@@ -703,7 +703,7 @@ def test_corporate_wallet_transactions
trans.each do |tran|
[ :created_at, :id, :quantity, :type_name, :type_id, :price,
:client_id, :client_name, :character_id, :station_id, :station_name, :type,
- :transaction_for ].each do |attr|
+ :transaction_for, :character_name ].each do |attr|
assert_not_nil(tran.send(attr))
end
assert_instance_of(Time, tran.created_at)
@@ -732,10 +732,10 @@ def test_corporate_wallet_journal_clean
assert_nothing_raised do
journal = @api.corporate_wallet_journal :url => File.join(XML_BASE,'corporate_wallet_journal.xml')
end
- assert_equal 2, journal.size
+ assert_equal 3, journal.size
assert journal.all? { |j| j.kind_of?(Reve::Classes::WalletJournal) }
journal.each do |j|
- [ :date, :ref_id, :reftype_id, :owner_name1, :owner_name2, :arg_name1, :amount, :balance, :reason ].each do |attr|
+ [ :date, :ref_id, :reftype_id, :owner_name1, :owner_name2, :arg_name1, :amount, :balance, :reason , :tax_amount, :tax_receiver_id].each do |attr|
assert_not_nil(j.send(attr))
end
end
@@ -1131,6 +1131,8 @@ def test_character_sheet_clean
assert_not_nil sheet.name
assert_not_nil sheet.race
+ assert_not_nil sheet.ancestry
+ assert_not_nil sheet.dob
assert_not_nil sheet.bloodline
assert_not_nil sheet.gender
assert_not_nil sheet.id
@@ -4,8 +4,10 @@
<result>
<characterID>892008733</characterID>
<name>Raquel Smith</name>
+ <DoB>2009-04-20 00:30:00</DoB>
<race>Caldari</race>
- <bloodLine>Civire</bloodLine>
+ <bloodLine>Civire</bloodLine>
+ <ancestry>Scientists</ancestry>
<gender>Female</gender>
<corporationName>Freedom-Technologies</corporationName>
<corporationID>1668136112</corporationID>
@@ -3,8 +3,9 @@
<currentTime>2008-02-03 14:51:03</currentTime>
<result>
<rowset columns="date,refID,refTypeID,ownerName1,ownerID1,ownerName2,ownerID2,argName1,argID1,amount,balance,reason" name="entries" key="refID">
- <row date="2008-02-03 14:47:00" argID1="1" argName1="EVE System" amount="-100.00" ownerID1="892804655" refID="922128913" ownerName1="Liquidator Brunt" refTypeID="46" ownerID2="1000035" reason="" ownerName2="Caldari Navy" balance="18004409.84">
- </row><row date="2008-02-03 14:47:00" argID1="0" argName1="" amount="-270.00" ownerID1="892804655" refID="922126594" ownerName1="Liquidator Brunt" refTypeID="42" ownerID2="0" reason="" ownerName2="" balance="18004509.84">
+ <row date="2008-08-20 13:10:00" refID="1575178032" refTypeID="85" ownerName1="CONCORD" ownerID1="1000125" ownerName2="anonymous" ownerID2="173993711" argName1="Jita" argID1="30001660" amount="135000.00" balance="609292267.52" reason="29200:15," taxReceiverID="1734917694" taxAmount="15000.00">
+ </row><row date="2008-08-20 13:10:00" refID="1575178032" refTypeID="85" ownerName1="CONCORD" ownerID1="1000125" ownerName2="anonymous" ownerID2="173993711" argName1="Jita" argID1="30001660" amount="135000.00" balance="609292267.52" reason="29200:15," taxReceiverID="1734917694" taxAmount="15000.00">
+ </row><row date="2008-08-20 13:10:00" refID="1575178032" refTypeID="85" ownerName1="CONCORD" ownerID1="1000125" ownerName2="anonymous" ownerID2="173993711" argName1="Jita" argID1="30001660" amount="135000.00" balance="609292267.52" reason="29200:15," taxReceiverID="1734917694" taxAmount="15000.00">
</row></rowset>
</result>
<cacheduntil>2008-02-03 15:51:03</cacheduntil>

0 comments on commit 891bc37

Please sign in to comment.