Class: GitHubEventWatcher::Event
- Inherits:
-
Object
- Object
- GitHubEventWatcher::Event
- Defined in:
- lib/github-event-watcher/event.rb
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(data) ⇒ Event
constructor
A new instance of Event.
- #payload ⇒ Object
- #repository_full_name ⇒ Object
- #repository_name ⇒ Object
- #repository_owner ⇒ Object
- #repository_url ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(data) ⇒ Event
Returns a new instance of Event.
18 19 20 21 |
# File 'lib/github-event-watcher/event.rb', line 18 def initialize(data) @data = data @repository = @data["repo"] end |
Instance Method Details
#id ⇒ Object
23 24 25 |
# File 'lib/github-event-watcher/event.rb', line 23 def id Integer(@data["id"]) end |
#payload ⇒ Object
31 32 33 |
# File 'lib/github-event-watcher/event.rb', line 31 def payload @data["payload"] end |
#repository_full_name ⇒ Object
51 52 53 |
# File 'lib/github-event-watcher/event.rb', line 51 def repository_full_name @repository["name"] end |
#repository_name ⇒ Object
45 46 47 48 49 |
# File 'lib/github-event-watcher/event.rb', line 45 def repository_name owner, name = repository_full_name.split("/", 2) _ = owner # For suppressing a warning name end |
#repository_owner ⇒ Object
39 40 41 42 43 |
# File 'lib/github-event-watcher/event.rb', line 39 def repository_owner owner, name = repository_full_name.split("/", 2) _ = name # For suppressing a warning owner end |
#repository_url ⇒ Object
35 36 37 |
# File 'lib/github-event-watcher/event.rb', line 35 def repository_url "https://github.com/#{repository_full_name}" end |
#type ⇒ Object
27 28 29 |
# File 'lib/github-event-watcher/event.rb', line 27 def type @data["type"] end |