Class: Pry::SendTweet::TwitterIO
- Inherits:
-
StringIO
- Object
- StringIO
- Pry::SendTweet::TwitterIO
- Defined in:
- lib/pry/send_tweet/twitter_io.rb
Overview
TwitterIO is a child of StringIO that implements an interface compatible with the expectations of the Twitter gem. The twitter gem expects a File object when uploading media, not an in-memory string as we would like.
Instance Method Summary collapse
- #basename ⇒ Object
-
#initialize(str, basename) ⇒ TwitterIO
constructor
A new instance of TwitterIO.
-
#to_str ⇒ Object
For compatibility with File.basename, which attempts String coercion when given an object other than a String.
Constructor Details
#initialize(str, basename) ⇒ TwitterIO
Returns a new instance of TwitterIO.
7 8 9 10 |
# File 'lib/pry/send_tweet/twitter_io.rb', line 7 def initialize(str, basename) super(str) @basename = basename end |
Instance Method Details
#basename ⇒ Object
12 13 14 |
# File 'lib/pry/send_tweet/twitter_io.rb', line 12 def basename @basename end |
#to_str ⇒ Object
For compatibility with File.basename, which attempts String coercion when given an object other than a String.
23 24 25 |
# File 'lib/pry/send_tweet/twitter_io.rb', line 23 def to_str basename end |