MacBook購入検討その1。

今まで一度も仕事以外で触ったことないMacを開発用に買っておこうかと思う。でも私はGoogleが好きでAndroid派!

どれを買えば?

Maxbookは、無印・Air・Proの3つがあるみたい。
基本引きこもりな私はそんなに持ち出したりはしないので、性能重視のProが良い。といっても画像や動画の編集なんかはしない。

SSDとメモリの容量は?

SSDを256G→512G、メモリを8G→16G。
それぞれカスタマイズしたいけど、高い。。
特にメモリはApple本家から買わないといけないから猶更。。

噂にきくと、MacbookWindowsを入れることができるらしい。
パーティション分けるならSSDは256ほしいな。
データ領域は共有できそうなら256でもいいかな。

どこで買えば?

メモリを16Gにするなら1,2。
そこを捨てるならネットショップが安そう。

  1. 公式
  2. 公式(整備品)
  3. 家電量販店
  4. ネットショップ

でも2016モデルとかの整備品がバランスがいいかなぁ。

急いで買う必要もないし、ゆっくり考えるか。

Rails + Twitter

昨日から、Twitter周りを作ってみてるんだけど。

OAuth

Tiwtterの情報を取得するには、OAuth認証が必要なんだけど、
この部分は以下のGemで簡単にできました。
github.com

トレンドの取得

github.com

使ったのは↑のGEMなんだけど、よくわからん。

↓「@return [Array]」が違う。TrendResultsだよね?

      # Returns the top 50 trending topics for a specific WOEID
      #
      # @see https://dev.twitter.com/rest/reference/get/trends/place
      # @rate_limited Yes
      # @authentication Requires user context
      # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
      # @param id [Integer] The {https://developer.yahoo.com/geo/geoplanet Yahoo! Where On Earth ID} of the location to return trending information for. WOEIDs can be retrieved by calling {Twitter::REST::Trends#trends_available}. Global information is available by using 1 as the WOEID.
      # @param options [Hash] A customizable set of options.
      # @option options [String] :exclude Setting this equal to 'hashtags' will remove all hashtags from the trends list.
      # @return [Array<Twitter::Trend>]
      def trends(id = 1, options = {})
        options = options.dup
        options[:id] = id
        response = perform_get('/1.1/trends/place.json', options).first
        Twitter::TrendResults.new(response)
      end

TrendResults を見てみると「/1.1/trends/place.json」の戻り値が入ったattrsを、@correctionに入れてんだけど、インスタンス変数だから外部から参照できん。
attr_readerが設定されているのはattrsだけなので、自前で@correctionを作る作業をしないといけないっぽい。うーむ。。

    # Initializes a new TrendResults object
    #
    # @param attrs [Hash]
    # @return [Twitter::TrendResults]
    def initialize(attrs = {})
      @attrs = attrs
      @collection = @attrs.fetch(:trends, []).collect do |trend|
        Trend.new(trend)
      end
    end

とりあえず、rubyの勉強。

とりあえず、rubyの記載方法を覚えないと時間かかる!
やはり、CやJavaとかとは全然違う。