これ https://github.com/gocardless/statesman
数多の state machine gem の一つ。
これ https://github.com/gocardless/statesman
数多の state machine gem の一つ。
から自分の環境にあった Ruby の最新版をダウンロード&インストール
Ruby でアプリケーション例外をつくるときの作り方。
begin
# 通常の処理
rescue SomeErrorException => e
# Exception から継承したクラスや StandardError から継承したクラスを指定で受ける
rescue => e # StandardError
# 継承木に StandardError がいるクラスのみひっかかる
else
Ruby のコードを読んでいると
class Hoge
class << self
def hello
puts 'hello'
end
end
end
test_cases = [ | |
%w[ docomo softbank au emobile willcom ], | |
%w[ development production testing staging ], | |
%w[ jp uk de ], | |
] | |
test_cases.first.product(*test_cases[1..-1]) do |carrier, env, region| | |
p carrier: carrier, | |
env: env, | |
region: region | |
end |
require 'bundler/setup' | |
module ExtendModule | |
def foo | |
'foo' | |
end | |
def bar | |
'bar' | |
end |
こんな指針がいいのかなー 2013 夏 ver.
.NET の「例外のデザインのガイドライン」にもこう書いてある。
select
c.id
from
user u
join
recipient r
on (u.id = r.user_id)
join
conversation c