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

#bio(description) ⇒ Object



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

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

#default(screen_name, consumer_key = nil) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/t/set.rb', line 24

def default(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.default_profile = {'username' => screen_name, 'consumer_key' => consumer_key}
  say "Default account has been updated."
end

#language(language_name) ⇒ Object



33
34
35
36
# File 'lib/t/set.rb', line 33

def language(language_name)
  client.settings(:lang => language_name)
  say "@#{@rcfile.default_profile[0]}'s language has been updated."
end

#location(place_name) ⇒ Object



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

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

#name(name) ⇒ Object



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

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

#url(url) ⇒ Object



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

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