Module: Twitter::Creatable
- Includes:
- Memoizable
- Included in:
- DirectMessage, DirectMessageEvent, DirectMessages::WelcomeMessage, DirectMessages::WelcomeMessageRule, List, SavedSearch, TrendResults, Tweet, User
- Defined in:
- lib/twitter/creatable.rb
Overview
Provides created_at functionality for Twitter objects
Instance Method Summary collapse
-
#created? ⇒ Boolean
Check if the created_at attribute is present.
-
#created_at ⇒ Time
Time when the object was created on Twitter.
Instance Method Details
#created? ⇒ Boolean
Check if the created_at attribute is present
30 31 32 |
# File 'lib/twitter/creatable.rb', line 30 def created? !!@attrs[:created_at] # steep:ignore FallbackAny end |
#created_at ⇒ Time
Time when the object was created on Twitter
15 16 17 18 19 20 21 |
# File 'lib/twitter/creatable.rb', line 15 def created_at time = @attrs[:created_at] # steep:ignore FallbackAny return if time.nil? time = Time.parse(time) unless time.is_a?(Time) time.utc end |