Module: Twitter::Creatable

Includes:
Memoizable
Included in:
DirectMessage, DirectMessageEvent, DirectMessages::WelcomeMessage, DirectMessages::WelcomeMessageRule, List, SavedSearch, TrendResults, Tweet, User
Defined in:
lib/twitter/creatable.rb

Instance Method Summary collapse

Instance Method Details

#created?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/twitter/creatable.rb', line 21

def created?
  !!@attrs[:created_at]
end

#created_atTime

Time when the object was created on Twitter

Returns:

  • (Time)


11
12
13
14
15
16
17
# File 'lib/twitter/creatable.rb', line 11

def created_at
  time = @attrs[:created_at]
  return if time.nil?

  time = Time.parse(time) unless time.is_a?(Time)
  time.utc
end