Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tiny fix to work with the Tyrannis mail API changes

  • Loading branch information...
commit 9f75a6607f3c5d4465605453f9026b03fb1fbd6f 1 parent 6f3e735
@dsander dsander authored Lisa Seelye committed
View
6 lib/reve/classes.rb
@@ -435,6 +435,8 @@ def initialize(elem)
@flag = elem['flag'].to_i
@singleton = elem['singleton'] == "1"
@assets = []
+ #@xml_hash = elem.to_s.gsub(/\n|\r|\s/,'')
+ #@xml_hash = ::Digest::SHA1.hexdigest elem.to_s.gsub(/\n|\r|\s/,'')
end
end
@@ -453,6 +455,8 @@ def initialize(elem) #:nodoc:
@quantity = elem['quantity'].to_i
@flag = elem['flag'].to_i
@singleton = elem['singleton'].to_i
+ #@xml_hash = elem.to_s.gsub(/\n|\r|\s/,'')
+ #@xml_hash = ::Digest::SHA1.hexdigest elem.to_s.gsub(/\n|\r|\s/,'')
end
end
@@ -1439,7 +1443,7 @@ def initialize(elem) #:nodoc:
@title = elem['title']
@to_corp_or_alliance_id = elem['toCorpOrAllianceID'] == '' ? nil : elem['toCorpOrAllianceID'].to_i
@to_character_ids = elem['toCharacterIDs'] == '' ? nil : elem['toCharacterIDs'].split(',').collect {|id| id.to_i }
- @to_list_ids = elem['toListIDs'] == '' ? nil : elem['toListIDs'].split(',').collect {|id| id.to_i }
+ @to_list_ids = elem['toListID'] == '' ? nil : elem['toListID'].split(',').collect {|id| id.to_i }
@read = elem['read'] == '1'
end
end
View
27 lib/reve/extensions.rb
@@ -87,6 +87,29 @@ def to_time(form = :utc)
end
end
end
+ module Array
+ def to_hash(space = 0)
+ hash = ""
+ each do |c|
+ vars = []
+ c.instance_variables.each do |m|
+ data = c.instance_variable_get(m)
+ if data.kind_of? Array
+ if data.length == 0
+ vars << "#{m} => {}"
+ else
+ vars << "#{m} => {\n#{data.to_hash(space + 1)}}"
+ end
+ else
+ vars << " #{m} => #{data}"
+ end
+ end
+ hash << "#{' ' * space}{#{vars.join(',')}}\n"
+ end
+ hash
+ end
+ end
+
end
end
@@ -106,6 +129,10 @@ class NilClass #:nodoc:
include Reve::Extensions::NilClass
end
+class Array #:nodoc:
+ include Reve::Extensions::Array
+end
+
class Object
def rsend(*args, &block)
obj = self
View
12 test/xml/mail_messages.xml
@@ -2,12 +2,12 @@
<eveapi version="2">
<currentTime>2009-12-02 00:46:10</currentTime>
<result>
- <rowset name="mailMessages" key="messageID" columns="messageID,senderID,sentDate,title,toCorpOrAllianceID,toCharacterIDs,toListIDs,read">
- <row messageID="290285276" senderID="1" sentDate="2009-12-01 01:04:00" title="Corp mail" toCorpOrAllianceID="4" toCharacterIDs="" toListIDs="" read="1" />
- <row messageID="290285275" senderID="2" sentDate="2009-12-01 01:04:00" title="Personal mail" toCorpOrAllianceID="" toCharacterIDs="5" toListIDs="" read="1" />
- <row messageID="290285274" senderID="2" sentDate="2009-12-01 01:04:00" title="Message to mailing list" toCorpOrAllianceID="" toCharacterIDs="" toListIDs="128250439" read="0" />
- <row messageID="290285278" senderID="2" sentDate="2009-12-01 01:04:00" title="Multi Personal mail" toCorpOrAllianceID="" toCharacterIDs="5,6,7" toListIDs="" read="1" />
- <row messageID="290285279" senderID="2" sentDate="2009-12-01 01:04:00" title="Multi Message to mailing list" toCorpOrAllianceID="" toCharacterIDs="" toListIDs="128250439,141157801" read="0" />
+ <rowset name="mailMessages" key="messageID" columns="messageID,senderID,sentDate,title,toCorpOrAllianceID,toCharacterIDs,toListID,read">
+ <row messageID="290285276" senderID="1" sentDate="2009-12-01 01:04:00" title="Corp mail" toCorpOrAllianceID="4" toCharacterIDs="" toListID="" read="1" />
+ <row messageID="290285275" senderID="2" sentDate="2009-12-01 01:04:00" title="Personal mail" toCorpOrAllianceID="" toCharacterIDs="5" toListID="" read="1" />
+ <row messageID="290285274" senderID="2" sentDate="2009-12-01 01:04:00" title="Message to mailing list" toCorpOrAllianceID="" toCharacterIDs="" toListID="128250439" read="0" />
+ <row messageID="290285278" senderID="2" sentDate="2009-12-01 01:04:00" title="Multi Personal mail" toCorpOrAllianceID="" toCharacterIDs="5,6,7" toListID="" read="1" />
+ <row messageID="290285279" senderID="2" sentDate="2009-12-01 01:04:00" title="Multi Message to mailing list" toCorpOrAllianceID="" toCharacterIDs="" toListID="128250439,141157801" read="0" />
</rowset>
</result>
<cachedUntil>2009-12-02 01:16:10</cachedUntil>
Please sign in to comment.
Something went wrong with that request. Please try again.