Class: HookSniff::Schema
- Inherits:
-
Object
- Object
- HookSniff::Schema
- Defined in:
- lib/hooksniff/api/schema.rb
Instance Method Summary collapse
- #get(id) ⇒ Object
-
#initialize(client) ⇒ Schema
constructor
A new instance of Schema.
- #list ⇒ Object
- #register(attrs) ⇒ Object
- #validate(id, attrs) ⇒ Object
Constructor Details
#initialize(client) ⇒ Schema
Returns a new instance of Schema.
5 6 7 |
# File 'lib/hooksniff/api/schema.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#get(id) ⇒ Object
13 14 15 |
# File 'lib/hooksniff/api/schema.rb', line 13 def get(id) @client.execute_request("GET", "/v1/schemas/#{id}") end |
#list ⇒ Object
9 10 11 |
# File 'lib/hooksniff/api/schema.rb', line 9 def list @client.execute_request("GET", "/v1/schemas") end |
#register(attrs) ⇒ Object
17 18 19 |
# File 'lib/hooksniff/api/schema.rb', line 17 def register(attrs) @client.execute_request("POST", "/v1/schemas", body: attrs) end |
#validate(id, attrs) ⇒ Object
21 22 23 |
# File 'lib/hooksniff/api/schema.rb', line 21 def validate(id, attrs) @client.execute_request("POST", "/v1/schemas/#{id}/validate", body: attrs) end |