calls now accept codeblocks - lets call this version 1.0.0

This commit is contained in:
danijoo
2014-01-01 19:59:06 +01:00
parent 466d0e8f66
commit dc6d037768
8 changed files with 62 additions and 12 deletions

View File

@@ -31,7 +31,12 @@ class StatsModule < SightstoneBaseModule
_parse_response(response) { |resp|
data = JSON.parse(resp)
return PlayerStatsSummaryList.new(data)
statList = PlayerStatsSummaryList.new(data)
if block_given?
yield statList
else
return statList
end
}
end
@@ -57,7 +62,12 @@ class StatsModule < SightstoneBaseModule
_parse_response(response) { |resp|
data = JSON.parse(resp)
return RankedStats.new(data)
stats = RankedStats.new(data)
if block_given?
yield stats
else
return stats
end
}
end