Class: Sensit::Api::Topic
- Inherits:
-
Object
- Object
- Sensit::Api::Topic
- Defined in:
- lib/sensit/api/topic.rb
Overview
A topic is root that data is attached to. It is the equivalent of a source in searchlight/solink and acts as a table which has columns(Fields) and rows(Feeds).
Instance Method Summary collapse
-
#create(topic, options = {}) ⇒ Object
Requires authorization of manage_any_data, or manage_application_data.
-
#delete(options = {}) ⇒ Object
Requires authorization of manage_any_data, or manage_application_data.
-
#find(options = {}) ⇒ Object
Requires authorization of read_any_data, or read_application_data.
-
#initialize(client) ⇒ Topic
constructor
A new instance of Topic.
-
#list(options = {}) ⇒ Object
Requires authorization of read_any_data, or read_application_data.
-
#update(topic, options = {}) ⇒ Object
Requires authorization of manage_any_data, or manage_application_data.
Constructor Details
#initialize(client) ⇒ Topic
Returns a new instance of Topic.
9 10 11 |
# File 'lib/sensit/api/topic.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#create(topic, options = {}) ⇒ Object
Requires authorization of manage_any_data, or manage_application_data. ‘/topics’ POST
topic - A hash containing the name/id of the topic (required) and a description of the topic.
39 40 41 42 43 44 45 46 |
# File 'lib/sensit/api/topic.rb', line 39 def create(topic, = {}) body = .has_key?(:body) ? [:body] : {} body[:topic] = topic response = @client.post "/topics", body, return response end |
#delete(options = {}) ⇒ Object
Requires authorization of manage_any_data, or manage_application_data. ‘/topics/:id’ DELETE
64 65 66 67 68 69 70 |
# File 'lib/sensit/api/topic.rb', line 64 def delete( = {}) body = .has_key?(:body) ? [:body] : {} response = @client.delete "/topics/:id", body, return response end |
#find(options = {}) ⇒ Object
Requires authorization of read_any_data, or read_application_data. ‘/topics/:id’ GET
27 28 29 30 31 32 33 |
# File 'lib/sensit/api/topic.rb', line 27 def find( = {}) body = .has_key?(:query) ? [:query] : {} response = @client.get "/topics/:id", body, return response end |
#list(options = {}) ⇒ Object
Requires authorization of read_any_data, or read_application_data. ‘/topics’ GET
16 17 18 19 20 21 22 |
# File 'lib/sensit/api/topic.rb', line 16 def list( = {}) body = .has_key?(:query) ? [:query] : {} response = @client.get "/topics", body, return response end |
#update(topic, options = {}) ⇒ Object
Requires authorization of manage_any_data, or manage_application_data. ‘/topics/:id’ PUT
topic - A hash containing the name/id of the topic (required) and a description of the topic.
52 53 54 55 56 57 58 59 |
# File 'lib/sensit/api/topic.rb', line 52 def update(topic, = {}) body = .has_key?(:body) ? [:body] : {} body[:topic] = topic response = @client.put "/topics/:id", body, return response end |