Skip to content

Instantly share code, notes, and snippets.

View carlism's full-sized avatar

Carl Leiby carlism

View GitHub Profile
require 'ostruct'
class Article < OpenStruct
def initialize(hash=nil, &blk)
super(hash)
instance_eval &blk if blk
end
def method_missing(method, *args)
super "#{method}=".to_sym, args