T
Travis Tslib
I'm messing with a gem called eve-api. I have a Perl and PHP
background. I'm messing with Ruby for the first time, and I've not read
any manual cover to cover. I'm crashing into this.
I've looked in Ruby Essentials and a few other places returned from a
Google query. In the gem is a file defining:
def account_transactions(character_id, type, account_key)
transactions = []
doc = @transport.call("#{type.to_s}/WalletTransactions.xml.aspx",
:characterID => character_id, :accountKey => account_key)
doc.each_element('//rowset[@name="transactions"]/row') do |row|
transaction = {
:date => DateTime.parse(row.attributes['transactionDateTime']),
:item => {
:id => row.attributes['typeID'].to_i,
:name => row.attributes['typeName']
}
}
transactions << transaction
end
return transactions
end
I've truncated that a bit.
In my code, when I call this, I can
myAccount.transactions.each do |trx|
puts "#{trx.date}"
end
I can't get to the ID or Name of the item. I've tried trx.item.id and
trx.item[0].id and a few other things. What is that? How can I access
it? The thing that really confuses me is trx.date works.
background. I'm messing with Ruby for the first time, and I've not read
any manual cover to cover. I'm crashing into this.
I've looked in Ruby Essentials and a few other places returned from a
Google query. In the gem is a file defining:
def account_transactions(character_id, type, account_key)
transactions = []
doc = @transport.call("#{type.to_s}/WalletTransactions.xml.aspx",
:characterID => character_id, :accountKey => account_key)
doc.each_element('//rowset[@name="transactions"]/row') do |row|
transaction = {
:date => DateTime.parse(row.attributes['transactionDateTime']),
:item => {
:id => row.attributes['typeID'].to_i,
:name => row.attributes['typeName']
}
}
transactions << transaction
end
return transactions
end
I've truncated that a bit.
In my code, when I call this, I can
myAccount.transactions.each do |trx|
puts "#{trx.date}"
end
I can't get to the ID or Name of the item. I've tried trx.item.id and
trx.item[0].id and a few other things. What is that? How can I access
it? The thing that really confuses me is trx.date works.