2012-11-14から1日間の記事一覧
def configure(&block) @config ||= Configuration.new block.call(@config) end configure do |config| config.use :yaml end みたいなのが、Object#instance_execを使うとスッキリ書ける。 def configure(&block) @config ||= Configuration.new @config.i…
def configure(&block) @config ||= Configuration.new block.call(@config) end configure do |config| config.use :yaml end みたいなのが、Object#instance_execを使うとスッキリ書ける。 def configure(&block) @config ||= Configuration.new @config.i…