class Pry::SendTweet::TwitterIO
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.
Public Class Methods
new(str, basename)
click to toggle source
Calls superclass method
# File lib/pry/send_tweet/twitter_io.rb, line 7 def initialize(str, basename) super(str) @basename = basename end
Public Instance Methods
basename()
click to toggle source
# File lib/pry/send_tweet/twitter_io.rb, line 12 def basename @basename end
to_str()
click to toggle source
For compatibility with File.basename, which attempts String coercion when given an object other than a String.
@example
File.basename(twitter_io) => {TwitterIO#basename}
# File lib/pry/send_tweet/twitter_io.rb, line 23 def to_str basename end