Class: Twitter::DirectMessages::WelcomeMessageWrapper
- Defined in:
- lib/twitter/direct_messages/welcome_message_wrapper.rb
Instance Attribute Summary collapse
-
#created_timestamp ⇒ Object
readonly
Returns the value of attribute created_timestamp.
Attributes inherited from Identity
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(attrs) ⇒ WelcomeMessageWrapper
constructor
A new instance of WelcomeMessageWrapper.
Methods inherited from Base
#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, display_uri_attr_reader, object_attr_reader, predicate_attr_reader, uri_attr_reader
Methods included from Utils
Constructor Details
#initialize(attrs) ⇒ WelcomeMessageWrapper
Returns a new instance of WelcomeMessageWrapper.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/twitter/direct_messages/welcome_message_wrapper.rb', line 11 def initialize(attrs) attrs = read_from_response(attrs) text = attrs.dig(:message_data, :text) urls = attrs.dig(:message_data, :entities, :urls) text.gsub!(urls[0][:url], urls[0][:expanded_url]) if urls.any? attrs[:welcome_message] = (attrs, text) super end |
Instance Attribute Details
#created_timestamp ⇒ Object (readonly)
Returns the value of attribute created_timestamp.
7 8 9 |
# File 'lib/twitter/direct_messages/welcome_message_wrapper.rb', line 7 def @created_timestamp end |