Class: TopTL::StatsResult
- Inherits:
-
Object
- Object
- TopTL::StatsResult
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
127
128
129
130
131
132
133
134
135
|
# File 'lib/toptl/types.rb', line 127
def self.from_hash(data)
data ||= {}
success = data.key?("success") ? data["success"] == true : true
new(
success: success,
username: data["username"],
raw: data
)
end
|