2008-02-01から1ヶ月間の記事一覧

仕事

最近というか、以前から仕事でC#+ASP+AJAX+Oracleしかやってない。Rubyの仕事がしたいです。

Singleton

require "singleton" module Singleton1 class Card include Singleton def use print "hello\n" end end end s1 = Singleton1::Card.instance s2 = Singleton1::Card.instance p s1 p s2 s1.use => #<Singleton1::Card:0xb7c74540> #<Singleton1::Card:0xb7c74540> hello 洗練された標準ライブラリを使いましょう。</singleton1::card:0xb7c74540></singleton1::card:0xb7c74540>

はてなブックマーク

今さらですけど、 「このエントリーを含むはてなブックマーク」ボタンを 追加しました。 Rankomic

自作Ruby on Railsアプリの

ブラウザを変えた訳でもないのに Rankomic のデザインがずれていた。なんだろこれ。

FactoryMethod その4

今回は動的にFactoryを生成しています。 るびまの添削記事からパクりました。 module FactoryMethod class IDCard def initialize(str) @owner = str end def use "#{@owner}のカードを使います" end end class Factory def create(str) create_product(str)…