Class: CorrectHorseBatteryStaple::Stats
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- CorrectHorseBatteryStaple::Stats
- Defined in:
- lib/correct_horse_battery_staple/stats.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_hash(hash) ⇒ Object
9 10 11 12 13 |
# File 'lib/correct_horse_battery_staple/stats.rb', line 9 def self.from_hash(hash) new.tap do |newobj| marshal_load(hash) end end |
.from_json(json) ⇒ Object
19 20 21 |
# File 'lib/correct_horse_battery_staple/stats.rb', line 19 def self.from_json(json) from_hash JSON.parse(json) end |
Instance Method Details
#to_hash ⇒ Object
5 6 7 |
# File 'lib/correct_horse_battery_staple/stats.rb', line 5 def to_hash marshal_dump end |
#to_json ⇒ Object
15 16 17 |
# File 'lib/correct_horse_battery_staple/stats.rb', line 15 def to_json to_hash.to_json end |