twitter-status-bot/.gems/gems/twitter-5.11.0/lib/twitter/creatable.rb

23 lines
403 B
Ruby

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