Class: T::Set

Inherits:
Thor
  • Object
show all
Includes:
Requestable
Defined in:
lib/t/set.rb

Constant Summary

Constants included from Requestable

Requestable::DEFAULT_HOST, Requestable::DEFAULT_PROTOCOL

Instance Method Summary collapse

Methods included from Requestable

#base_url, #client, #host, included, #protocol

Constructor Details

#initializeSet

Returns a new instance of Set.



12
13
14
15
# File 'lib/t/set.rb', line 12

def initialize(*)
  super
  @rcfile = RCFile.instance
end

Instance Method Details

#active(screen_name, consumer_key = nil) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/t/set.rb', line 18

def active(screen_name, consumer_key=nil)
  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' => screen_name, 'consumer_key' => consumer_key}
  say "Active account has been updated."
end

#bio(description) ⇒ Object



28
29
30
31
# File 'lib/t/set.rb', line 28

def bio(description)
  client.update_profile(:description => description, :include_entities => false)
  say "@#{@rcfile.active_profile[0]}'s bio has been updated."
end

#language(language_name) ⇒ Object



34
35
36
37
# 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) ⇒ Object



40
41
42
43
# File 'lib/t/set.rb', line 40

def location(place_name)
  client.update_profile(:location => place_name, :include_entities => false)
  say "@#{@rcfile.active_profile[0]}'s location has been updated."
end

#name(name) ⇒ Object



46
47
48
49
# File 'lib/t/set.rb', line 46

def name(name)
  client.update_profile(:name => name, :include_entities => false)
  say "@#{@rcfile.active_profile[0]}'s name has been updated."
end

#url(url) ⇒ Object



52
53
54
55
# File 'lib/t/set.rb', line 52

def url(url)
  client.update_profile(:url => url, :include_entities => false)
  say "@#{@rcfile.active_profile[0]}'s URL has been updated."
end