Class: Bastille::Hub
- Inherits:
-
Object
- Object
- Bastille::Hub
- Defined in:
- lib/bastille/hub.rb
Instance Method Summary collapse
- #authenticate! ⇒ Object
-
#initialize(username, token) ⇒ Hub
constructor
A new instance of Hub.
- #member_of_space?(space) ⇒ Boolean
- #spaces ⇒ Object
Constructor Details
#initialize(username, token) ⇒ Hub
Returns a new instance of Hub.
4 5 6 7 |
# File 'lib/bastille/hub.rb', line 4 def initialize(username, token) @login = username @oauth = token end |
Instance Method Details
#authenticate! ⇒ Object
9 10 11 12 13 14 |
# File 'lib/bastille/hub.rb', line 9 def authenticate! client.ratelimit true rescue Octokit::Unauthorized false end |
#member_of_space?(space) ⇒ Boolean
20 21 22 |
# File 'lib/bastille/hub.rb', line 20 def member_of_space?(space) spaces.include?(space) end |
#spaces ⇒ Object
16 17 18 |
# File 'lib/bastille/hub.rb', line 16 def spaces [@login] + client.organizations.collect(&:login) end |