Sha256: e549c10c30852d8223057cbc79c132fbffef8554b24b96f527d5b9b5f5678472

Contents?: true

Size: 403 Bytes

Versions: 17

Compression:

Stored size: 403 Bytes

Contents

require 'time'
require 'memoizable'

module Twitter
  module Creatable
    include Memoizable

    # Time when the object was created on Twitter
    #
    # @return [Time]
    def created_at
      Time.parse(@attrs[:created_at]) unless @attrs[:created_at].nil?
    end
    memoize :created_at

    # @return [Boolean]
    def created?
      !!@attrs[:created_at]
    end
    memoize :created?
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
twitter-6.1.0 lib/twitter/creatable.rb
twitter-6.0.0 lib/twitter/creatable.rb
twitter-5.17.0 lib/twitter/creatable.rb
twitter-5.16.0 lib/twitter/creatable.rb
twitter-5.15.0 lib/twitter/creatable.rb
twitter-5.14.0 lib/twitter/creatable.rb
twitter-5.13.0 lib/twitter/creatable.rb
twitter-5.12.0 lib/twitter/creatable.rb
twitter-5.11.0 lib/twitter/creatable.rb
twitter-5.10.0 lib/twitter/creatable.rb
twitter-5.9.0 lib/twitter/creatable.rb
twitter-5.8.0 lib/twitter/creatable.rb
twitter-5.7.1 lib/twitter/creatable.rb
twitter-5.7.0 lib/twitter/creatable.rb
twitter-5.6.0 lib/twitter/creatable.rb
twitter-5.5.1 lib/twitter/creatable.rb
twitter-5.5.0 lib/twitter/creatable.rb