Class: TopTL::VoteCheck

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/toptl/types.rb

Instance Attribute Summary

Attributes included from Model

#raw

Class Method Summary collapse

Methods included from Model

included, #initialize, #to_h

Class Method Details

.from_hash(data) ⇒ Object



111
112
113
114
115
116
117
118
# File 'lib/toptl/types.rb', line 111

def self.from_hash(data)
  data ||= {}
  new(
    voted: (data["voted"] || data["hasVoted"]) == true,
    voted_at: data["votedAt"],
    raw: data
  )
end