module FromHash
Constants
- VERSION
Public Class Methods
new(hash = {})
click to toggle source
# File lib/from_hash.rb, line 4 def initialize(hash = {}) from_hash(hash) end
Public Instance Methods
from_hash(hash)
click to toggle source
# File lib/from_hash.rb, line 8 def from_hash(hash) hash.each do |key, value| send "#{key}=", value end self end