add gs
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
--[[
|
||||
{
|
||||
upVotes : number ,
|
||||
downVotes : number ,
|
||||
userVote : bool or nil,
|
||||
canVote : bool ,
|
||||
cantVoteReason : string ,
|
||||
}
|
||||
]]
|
||||
|
||||
local VoteData = {}
|
||||
|
||||
function VoteData.new()
|
||||
local self = {}
|
||||
return self
|
||||
end
|
||||
|
||||
function VoteData.fromJsonData(voteJson)
|
||||
local self = VoteData.new()
|
||||
self.upVotes = voteJson.UpVotes
|
||||
self.downVotes = voteJson.DownVotes
|
||||
self.userVote = voteJson.UserVote
|
||||
self.canVote = voteJson.CanVote
|
||||
self.cantVoteReason = voteJson.ReasonForNotVoteable
|
||||
return self
|
||||
end
|
||||
|
||||
return VoteData
|
||||
Reference in New Issue
Block a user