Sha256: cee3c56a9804b38648d15694960af25dc4972d0207efe1475f838080cee8544e
Contents?: true
Size: 471 Bytes
Versions: 2
Compression:
Stored size: 471 Bytes
Contents
module Pushybullet module Concerns module FromHash def from_hash(data) o = new data.each do |key, value| o.send("#{key}=", value) end o end end module ToHash def to_hash d = {} instance_variables.each do |name| val = instance_variable_get(name) d[name[1..-1]] = val unless val.nil? end d end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pushybullet-0.1.1 | lib/pushybullet/concerns.rb |
pushybullet-0.1.0 | lib/pushybullet/concerns.rb |