Class: Payload
- Inherits:
-
Object
show all
- Defined in:
- lib/robot_sweatshop/payload/payload.rb
Overview
The base interface that the payload parser will be expecting
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.hash_keys ⇒ Object
3
4
5
|
# File 'lib/robot_sweatshop/payload/payload.rb', line 3
def self.hash_keys
%w(author hash branch message repo_slug source_url clone_url)
end
|
Instance Method Details
#to_hash ⇒ Object
7
8
9
10
11
|
# File 'lib/robot_sweatshop/payload/payload.rb', line 7
def to_hash
keys = Payload.hash_keys
values = Payload.hash_keys.map { |method| method(method.to_sym).call }
[keys, values].transpose.to_h
end
|