Class: Github::Notification
- Inherits:
-
Object
- Object
- Github::Notification
- Includes:
- Base
- Defined in:
- lib/hubdate/notification.rb
Instance Attribute Summary
Attributes included from Base
Class Method Summary collapse
-
.fetch(conn = Github::Connection.new) ⇒ Object
Generate JSON hash and create new Github::Repository object through Github::Base.
-
.list(params = {}, conn = Github::Connection.new) ⇒ Object
Do some argument checking and then return an array of repository objects.
Instance Method Summary collapse
Methods included from Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Github::Base
Class Method Details
.fetch(conn = Github::Connection.new) ⇒ Object
Generate JSON hash and create new Github::Repository object through Github::Base
6 7 8 9 10 11 |
# File 'lib/hubdate/notification.rb', line 6 def self.fetch(conn = Github::Connection.new) raise ArgumentError.new("You must be authenticated to retrieve this information!") if !connection.authenticated? responseHash = conn.get("/notifications") new(responseHash, conn) end |
.list(params = {}, conn = Github::Connection.new) ⇒ Object
Do some argument checking and then return an array of repository objects
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/hubdate/notification.rb', line 22 def self.list(params = {}, conn = Github::Connection.new) conn = params if params.class == Github::Connection params = {} if params.class == Github::Connection notifications = conn.get("/notifications", params) notifications.map do |notification| new(notification, conn) end end |
Instance Method Details
#message ⇒ Object
13 14 15 |
# File 'lib/hubdate/notification.rb', line 13 def subject["title"] end |
#type ⇒ Object
17 18 19 |
# File 'lib/hubdate/notification.rb', line 17 def type subject["type"] end |