class T::Set
Public Class Methods
new(*)
click to toggle source
Calls superclass method
# File lib/t/set.rb, line 11 def initialize(*) @rcfile = T::RCFile.instance super end
Public Instance Methods
active(screen_name, consumer_key = nil)
click to toggle source
# File lib/t/set.rb, line 17 def active(screen_name, consumer_key = nil) require "t/core_ext/string" screen_name = screen_name.strip_ats @rcfile.path = options["profile"] if options["profile"] consumer_key = @rcfile[screen_name].keys.last if consumer_key.nil? @rcfile.active_profile = {"username" => @rcfile[screen_name][consumer_key]["username"], "consumer_key" => consumer_key} say "Active account has been updated to #{@rcfile.active_profile[0]}." end
bio(description)
click to toggle source
# File lib/t/set.rb, line 28 def bio(description) client.update_profile(description:) say "@#{@rcfile.active_profile[0]}'s bio has been updated." end
language(language_name)
click to toggle source
# File lib/t/set.rb, line 34 def language(language_name) client.settings(lang: language_name) say "@#{@rcfile.active_profile[0]}'s language has been updated." end
location(place_name)
click to toggle source
# File lib/t/set.rb, line 40 def location(place_name) client.update_profile(location: place_name) say "@#{@rcfile.active_profile[0]}'s location has been updated." end
name(name)
click to toggle source
# File lib/t/set.rb, line 46 def name(name) client.update_profile(name:) say "@#{@rcfile.active_profile[0]}'s name has been updated." end
profile_background_image(file)
click to toggle source
# File lib/t/set.rb, line 53 def profile_background_image(file) client.update_profile_background_image(File.new(File.expand_path(file)), tile: options["tile"], skip_status: true) say "@#{@rcfile.active_profile[0]}'s background image has been updated." end
profile_image(file)
click to toggle source
# File lib/t/set.rb, line 60 def profile_image(file) client.update_profile_image(File.new(File.expand_path(file))) say "@#{@rcfile.active_profile[0]}'s image has been updated." end
website(uri)
click to toggle source
# File lib/t/set.rb, line 67 def website(uri) client.update_profile(url: uri) say "@#{@rcfile.active_profile[0]}'s website has been updated." end