Class: Twitter::User

Inherits:
Object
  • Object
show all
Defined in:
lib/twittermotion/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ac_account) ⇒ User

Returns a new instance of User.



5
6
7
# File 'lib/twittermotion/user.rb', line 5

def initialize()
  self. = 
end

Instance Attribute Details

#ac_accountObject

Returns the value of attribute ac_account.



3
4
5
# File 'lib/twittermotion/user.rb', line 3

def 
  @ac_account
end

Instance Method Details

#compose(options = {}, &block) ⇒ Object

user.compose(tweet: ‘initial tweet’, images: [ui_image, ui_image],

urls: ["http://", ns_url, ...]) do |composer|

end



17
18
19
20
21
22
# File 'lib/twittermotion/user.rb', line 17

def compose(options = {}, &block)
  @composer = Twitter::Composer.new
  @composer.compose(options) do |composer|
    block.call(composer)
  end
end

#get_timeline(options = {}, &block) ⇒ Object

user.get_timeline(include_entities: 1) do |hash, ns_error| end



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/twittermotion/user.rb', line 26

def get_timeline(options = {}, &block)
  url = NSURL.URLWithString("http://api.twitter.com/1/statuses/home_timeline.json")
  request = TWRequest.alloc.initWithURL(url, parameters:options, requestMethod:TWRequestMethodGET)
  request. = self.
  request.performRequestWithHandler(lambda {|response_data, url_response, error|
    if !response_data
      block.call(nil, error)
    else
      block.call(BubbleWrap::JSON.parse(response_data), nil)
    end
  })
end

#usernameObject



9
10
11
# File 'lib/twittermotion/user.rb', line 9

def username
  self..username
end