Module: Twitter
- Defined in:
- lib/twittermotion/user.rb,
lib/twittermotion/twitter.rb,
lib/twittermotion/version.rb,
lib/twittermotion/composer.rb
Defined Under Namespace
Classes: Composer, ComposerError, User
Constant Summary
collapse
- VERSION =
"0.0.2"
Class Method Summary
collapse
Class Method Details
.account_store ⇒ Object
3
4
5
|
# File 'lib/twittermotion/twitter.rb', line 3
def account_store
@account_store ||= ACAccountStore.new
end
|
.account_type ⇒ Object
7
8
9
|
# File 'lib/twittermotion/twitter.rb', line 7
def account_type
@account_type ||= self.account_store.accountTypeWithAccountTypeIdentifier(ACAccountTypeIdentifierTwitter)
end
|
.accounts ⇒ Object
11
12
13
14
15
|
# File 'lib/twittermotion/twitter.rb', line 11
def accounts
@accounts ||= self.account_store.accountsWithAccountType(account_type).collect do |ac_account|
Twitter::User.new(ac_account)
end
end
|
.sign_in(&block) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/twittermotion/twitter.rb', line 17
def sign_in(&block)
@sign_in_callback = block
self.account_store.requestAccessToAccountsWithType(self.account_type,
withCompletionHandler:lambda { |granted, error|
@accounts = nil
Dispatch::Queue.main.sync {
@sign_in_callback.call(granted, error)
}
})
end
|