Module: Crown::CGM

Defined in:
lib/crown/cgm.rb,
lib/crown/cgm/countable.rb

Defined Under Namespace

Modules: Countable

Class Method Summary collapse

Class Method Details

.proxy(service) ⇒ Object

——————————————————————- #

proxy

シンボルを利用して目的の CGM の API へアクセスするための
Abstract Factory メソッド.実装されている CGM は以下の通り:

- Twitter
  http://twitter.com/
- Topsy (Twitter のりツイート数カウントサービス)
  http://topsy.com/
- TweetMeme (同上)
  http://tweetmeme.com/
- BackType (BackTweets, 同上,要 API key)
  http://backtweets.com/
- Facebook
  http://www.facebook.com/
- はてなブックマーク
  http://b.hatena.ne.jp/
- Livedoor クリップ
  http://clip.livedoor.com/
- Livedoor Reader
  http://reader.livedoor.com/
- Delicious
  http://delicious.com/
- Buzzurl
  http://buzzurl.jp/
- Yahoo! ブックマーク
  http://bookmarks.yahoo.co.jp/

——————————————————————- #



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/crown/cgm.rb', line 79

def proxy(service)
    case service
    when :twitter_user    then return Crown::Twitter::User.new
    when :twitter_uri     then return Crown::Twitter::URI.new
    when :topsy           then return Crown::Topsy.new
    when :tweetmeme       then return Crown::TweetMeme.new
    when :backtype        then return Crown::BackType.new
    when :facebook        then return Crown::Facebook.new
    when :hatena_bookmark then return Crown::Hatena::Bookmark.new
    when :livedoor_clip   then return Crown::Livedoor::Clip.new
    when :livedoor_reader then return Crown::Livedoor::Reader.new
    when :delicious       then return Crown::Delicious.new
    when :buzzurl         then return Crown::Buzzurl.new
    when :yahoo_bookmark  then return Crown::Yahoo::Bookmark.new
    else return nil
    end
end