Sha256: 8e6305279094063dedd11a1e0a44b77da45fb146a2c237d884e5ef40509fd09a
Contents?: true
Size: 360 Bytes
Versions: 1
Compression:
Stored size: 360 Bytes
Contents
class Hash def to_struct(name = nil) name = "Hash" if name.blank? struct = Struct.new(name.to_s, *(keys.collect{ |key| key.to_sym })) returning(struct.new){ |struct| each{ |k, v| struct.send("#{k}=", v) }} end end class Object def meta_eval(&block) (class << self; self; end).instance_eval(&block) end def full? !blank? end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cjbottaro-curly_mustache-0.0.0 | lib/helpers.rb |