u16suzuの blog

日々学んだことのメモブログです。

2017-12-01から1ヶ月間の記事一覧

あるオブジェクトに対して1回で複数のメソッドを呼ぶ

書いて見た。jbuilderっぽい見た目になった。 class Object def call(*methods) methods.map do |method| self.send(method) end end end p [1,2,3].(:first, :last, :class) # => [1, 3, Array]

Reactのメモ

準備 sudo npm install -g react-tools # jsファイルをwatch して自動ビルドをさせる jsx --watch src/ build/ html <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <script src="https://fb.me/react-15.1.0.js"></script> <script src="https://fb.me/react-dom-15.1.0.js"></script> …</meta></head></html>